allendaicool / thrust

Automatically exported from code.google.com/p/thrust
Apache License 2.0
0 stars 0 forks source link

"error: kernel launches from templates are not allowed in system files" when using thrust::sort #184

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A simple call of 
thrust::device_vector<int> test(12);
thrust::sort(test.begin(), test.end());

fails at compilation with output :

/usr/local/cuda/bin/../include/thrust/detail/device/cuda/detail/stable_radix_sor
t.inl(1047): error: kernel launches from templates are not allowed in system 
files

Using thrust 1.2.1 with nvcc 3.0 and gcc 4.3.4, on Ubuntu 10.04, kernel 2.6.32, 
64bis.

Original issue reported on code.google.com by georges....@laposte.net on 27 Jul 2010 at 2:13

GoogleCodeExporter commented 9 years ago
Oups, forgot to end the message :

The same problem happened with thrust 1.2 too, and updating didn't fix it.

The problem happens too with stable_sort (as a matter or fact, the given output 
is for stable_sort).

I have no idea what caused that, and google won't give me a clue about the 
error message.

Any idea ?

Original comment by georges....@laposte.net on 27 Jul 2010 at 2:16

GoogleCodeExporter commented 9 years ago
Thanks for the report.

This error is new to me too.  Do you happen to have another copy of Thrust 
installed in /usr/include or /usr/local/include?

Original comment by wnbell on 27 Jul 2010 at 8:12

GoogleCodeExporter commented 9 years ago
I indeed had a symlink from /usr/include/local/thrust to 
/usr/include/local/cuda/thrust, and my IDE created the inclusion directive as 
"#include <../cuda/include/thrust/sort.h>". That's my mistake.

Still, I wonder why this caused thrust to crash.

Original comment by georges....@laposte.net on 29 Jul 2010 at 12:24

GoogleCodeExporter commented 9 years ago
My understanding is that nvcc treats system headers differently that headers 
stored in other locations.  I'm not exactly sure why this is done, but it does 
prevent us from installing Thrust to those paths.

Original comment by wnbell on 29 Jul 2010 at 4:28

GoogleCodeExporter commented 9 years ago
So what is the solution, I tried putting the thrust library in 
\usr\local\cuda\include\thrust , it throws the same type of errors

mu cuda ver is 3.2 and thrust 1.3.0, can I get any help. Thanks!

Original comment by mallahar...@gmail.com on 16 Apr 2011 at 5:30

GoogleCodeExporter commented 9 years ago
hope my post at the end helps.

http://forums.nvidia.com/index.php?showtopic=194605

Cheers!

Original comment by emil.va...@gmail.com on 9 May 2011 at 9:57

GoogleCodeExporter commented 9 years ago
thanks for the help I will try and let you know!

Original comment by mallahar...@gmail.com on 9 May 2011 at 10:04

GoogleCodeExporter commented 9 years ago
Issue 386 has been merged into this issue.

Original comment by jaredhoberock on 6 Oct 2011 at 10:11