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

reference to __host__ function 'free'/'malloc' in __host__ __device__ function #355

Closed
jinz2014 opened this issue Jan 1, 2024 · 7 comments
Assignees

Comments

@jinz2014
Copy link

jinz2014 commented Jan 1, 2024

Compiling a HIP program shows the following errors. Thanks for your suggestion.

In file included from /opt/rocm-6.0.0/include/thrust/system/detail/adl/malloc_and_free.h:26:
/opt/rocm-6.0.0/include/thrust/system/detail/sequential/malloc_and_free.h:45:8: error: reference to __host__ function 'free' in __host__ __device__ function
  std::free(thrust::raw_pointer_cast(ptr));


In file included from /opt/rocm-6.0.0/include/thrust/system/detail/adl/malloc_and_free.h:26:
/opt/rocm-6.0.0/include/thrust/system/detail/sequential/malloc_and_free.h:37:15: error: reference to __host__ function 'malloc' in __host__ __device__ function
  return std::malloc(n);
@doctorcolinsmith
Copy link
Collaborator

@jinz2014 Thanks for reporting the issue. It is known to our team and we will follow up on it.

@doctorcolinsmith doctorcolinsmith self-assigned this Jan 5, 2024
@jinz2014
Copy link
Author

jinz2014 commented Jan 5, 2024

I didn't know the issue until migrating CUDA sources and building the HIP codes. If the CUDA sources are needed for your test, please let me know.

@doctorcolinsmith
Copy link
Collaborator

@jinz2014 If you have a reproducer you can share, we will include it in our testing.

@jinz2014
Copy link
Author

In the example,

https://github.com/zjin-lcf/HeCBench/tree/master/src/logic-rewrite-hip

Type "make" may reproduce the error.

@zichguan-amd
Copy link

Fixed in LLVM and works in latest ROCm

@jinz2014
Copy link
Author

jinz2014 commented Nov 5, 2024

Is the latest ROCm available ? Thanks.

@zichguan-amd
Copy link

You can find ROCm 6.2.2 installation steps here: https://rocm.docs.amd.com/projects/install-on-linux/en/develop/install/quick-start.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants