-
Notifications
You must be signed in to change notification settings - Fork 134
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
Question and errors compiling for -fopenmp-targets=nvptx64-nvidia-cuda #847
Comments
@grypp Güray, is this something you have any information about? |
Hello @justxi |
Hi @grypp
Ok, that would explain that I have the same number of threads as CPU cores.
I modified the program:
Compiling with:
But I get this error again:
|
@grypp Is there an example which is known to work using Fortran to offload to nVidia GPU? |
@justxi can you try the following more simple case, and check whether it has some issue? PROGRAM OFFLOADINF_DEMO
USE OMP_LIB
INTEGER :: isHost = -1
character*16 :: name
!$OMP TARGET MAP (from: isHost)
isHost = OMP_IS_INITIAL_DEVICE()
!$OMP END TARGET
if (isHost < 0) then
PRINT *, "Runtime error, isHost = I3", isHost
end if
! CHECK: Target region executed on the device
if (isHost) then
name = "host"
else
name = "device"
endif
PRINT *,"Target region executed on the ", name
END |
I compiled flang following this guide https://github.com/flang-compiler/flang/wiki/Building-Flang, except that I used release_90, added the NVPTX target, LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES="35,61" and GCC 9.2.
When I use the following program:
Compiling it with
It works as expected on the CPU with 8 threads, on the GPU I see only 8 threads also.
Is this correct?
I modified the example to use target:
Then I get the following error:
When I comment out "print *, "omp_get_num_devices = "..."
I get:
I saved all program codes as: test{0,1,1a}.f90
What I am doing wrong?
Programs with the same function using "C" programming language and Clang 9.0.1 works as expected.
The text was updated successfully, but these errors were encountered: