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

HIP with NVIDIA #30

Closed
rjfnobre opened this issue Jul 19, 2016 · 1 comment
Closed

HIP with NVIDIA #30

rjfnobre opened this issue Jul 19, 2016 · 1 comment

Comments

@rjfnobre
Copy link

When compiling on a machine with an AMD card I do the following and it works:
gcc -c main.c misc.c -DTYPE=float
hipcc -O2 Kernel.hip.cpp main.o misc.o -DTYPE=float -o kernel_hip_float

But when compiling a machine with an NVIDIA card (and with theCUDA toolkit installed) I get lots of 'warning: null character(s) ignored' and 'error: unrecognized token' errors (reported for the 'main.o' object file) when executing the second command.

What is the correct way of compiling and linking multiple files, where only a single file includes the HIP runtime library (in this example 'Kernel.hip.cpp')?

@mangupta
Copy link
Contributor

Splitting the second step into a separate compilation and linking step should fix the problem i.e. do something like:

hipcc -O2 -c Kernel.hip.cpp -DTYPE=float -o Kernel.hip.o
hipcc Kernel.hip.o main.o misc.o -o kernel_hip_float

The problem is due to the way nvcc tries to detect if the file needs to be compiled using CUDA mode or pass-through CPP mode.

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

2 participants