Reputation: 4259
I am importing a library and I get this error when compiling:
go.cu(61): error: calling a __host__ function("TinyJS::Interpreter::Interpreter()") from a __global__ function("capnduk_kernel") is not allowed
...is there a way to port an entire file (TinyJS) to run on the device?
I've checked the compiler documentation, and it doesn't look like there's a way to do this. I'm guessing the only way is to rewrite the file by hand, which is a can of worms.
Upvotes: 0
Views: 334
Reputation: 132096
While NVCC does not support this (as Robert points out), this is an option for run-time compilation, via the NVRTC library:
Documentation lists the following compilation option:
--device-as-default-execution-space
(-default-device
)Treat entities with no execution space annotation as
__device__
entities.
Notes:
Upvotes: 0
Reputation: 152143
There isn't a way to do this with nvcc
. It will require manual effort.
Upvotes: 2