Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling a __host__ function from a __host__ __device__ function is not allowed #103

Open
hygxy opened this issue Aug 29, 2022 · 0 comments

Comments

@hygxy
Copy link

hygxy commented Aug 29, 2022

this method is annotated with the flag "__host__ __device__ ", which indicates that it can be called both from host and device. However, (how)is it guaranteed that the calls to Eigen methods within it(eig.computeDirect, eig.eigenvalues, values.asDiagonal, eig.eigenvectors().inverse), can be called both from host and device as well?

I open this issue because I encountered the following error:

terminate called after throwing an instance of 'thrust::system::system_error'
what():  for_each: failed to synchronize: cudaErrorIllegalAddress: an illegal memory access was encountered

Through debugging I find that the code snippets which cause the error are following:

if (cudaSuccess != status)
  {
    if (THRUST_IS_HOST_CODE) {
      #if THRUST_INCLUDE_HOST_CODE
        throw thrust::system_error(status, thrust::cuda_category(), msg);
      #endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant