{"action":"created","issue":{"url":"https://api.github.com/repos/clang-ykt/clang/issues/22","repository_url":"https://api.github.com/repos/clang-ykt/clang","labels_url":"https://api.github.com/repos/clang-ykt/clang/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/clang-ykt/clang/issues/22/comments","events_url":"https://api.github.com/repos/clang-ykt/clang/issues/22/events","html_url":"https://github.com/clang-ykt/clang/issues/22","id":332777499,"node_id":"MDU6SXNzdWUzMzI3Nzc0OTk=","number":22,"title":"Offloading to Nvidia Kepler GPU","user":{"login":"siddharth19","id":19682193,"node_id":"MDQ6VXNlcjE5NjgyMTkz","avatar_url":"https://avatars0.githubusercontent.com/u/19682193?v=4","gravatar_id":"","url":"https://api.github.com/users/siddharth19","html_url":"https://github.com/siddharth19","followers_url":"https://api.github.com/users/siddharth19/followers","following_url":"https://api.github.com/users/siddharth19/following{/other_user}","gists_url":"https://api.github.com/users/siddharth19/gists{/gist_id}","starred_url":"https://api.github.com/users/siddharth19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddharth19/subscriptions","organizations_url":"https://api.github.com/users/siddharth19/orgs","repos_url":"https://api.github.com/users/siddharth19/repos","events_url":"https://api.github.com/users/siddharth19/events{/privacy}","received_events_url":"https://api.github.com/users/siddharth19/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-15T13:41:08Z","updated_at":"2018-06-16T08:33:48Z","closed_at":null,"author_association":"NONE","body":"clang -O3 -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-linux -o saxpy saxpy.c\r\nUsed this command to compile the code. Got the error:\r\n\r\nnvlink error   : Undefined reference to '__kmpc_kernel_parallel' in '/tmp/saxpy-0c5610.cubin'\r\nnvlink error   : Undefined reference to '__kmpc_kernel_end_parallel' in '/tmp/saxpy-0c5610.cubin'\r\nnvlink error   : Undefined reference to '__kmpc_kernel_init' in '/tmp/saxpy-0c5610.cubin'\r\nnvlink error   : Undefined reference to '__kmpc_kernel_deinit' in '/tmp/saxpy-0c5610.cubin'\r\n/usr/bin/ld: cannot find /tmp/saxpy-97687a.out\r\n/usr/bin/ld: cannot find /tmp/saxpy-97687a.out\r\nclang-6.0: error: fatbinary command failed with exit code 255 (use -v to see invocation)\r\nclang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)\r\n\r\nSearching for it I realised this is due to difference in architecture(Using Kepler GPU).\r\nUsed this cmake command:\r\ncmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=../../install -DLLVM_ENABLE_BACKTRACES=ON -DLLVM_ENABLE_WERROR=OFF -DBUILD_SHARED_LIBS=OFF -DLLVM_ENABLE_RTTI=ON -DOPENMP_ENABLE_LIBOMPTARGET=ON -DCMAKE_C_FLAGS='-DOPENMP_NVPTX_COMPUTE_CAPABILITY=20' -DCMAKE_CXX_FLAGS='-DOPENMP_NVPTX_COMPUTE_CAPABILITY=20' -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITY=20 -DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_20 -DLIBOMPTARGET_NVPTX_ENABLE_BCLIB=true -G \"Unix Makefiles\" ../\r\n\r\n**BUT when using cmake I got this message:**\r\nCMake Warning at tools/clang/CMakeLists.txt:251 (message):\r\n  Resetting default architecture for OpenMP offloading to Nvidia GPUs to\r\n  sm_35\r\n\r\nCMake Warning:\r\n  Manually-specified variables were not used by the project:\r\n\r\n    LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITY\r\n    LIBOMPTARGET_NVPTX_ENABLE_BCLIB\r\n\r\nWhy is this??"},"comment":{"url":"https://api.github.com/repos/clang-ykt/clang/issues/comments/397797723","html_url":"https://github.com/clang-ykt/clang/issues/22#issuecomment-397797723","issue_url":"https://api.github.com/repos/clang-ykt/clang/issues/22","id":397797723,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Nzc5NzcyMw==","user":{"login":"siddharth19","id":19682193,"node_id":"MDQ6VXNlcjE5NjgyMTkz","avatar_url":"https://avatars0.githubusercontent.com/u/19682193?v=4","gravatar_id":"","url":"https://api.github.com/users/siddharth19","html_url":"https://github.com/siddharth19","followers_url":"https://api.github.com/users/siddharth19/followers","following_url":"https://api.github.com/users/siddharth19/following{/other_user}","gists_url":"https://api.github.com/users/siddharth19/gists{/gist_id}","starred_url":"https://api.github.com/users/siddharth19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddharth19/subscriptions","organizations_url":"https://api.github.com/users/siddharth19/orgs","repos_url":"https://api.github.com/users/siddharth19/repos","events_url":"https://api.github.com/users/siddharth19/events{/privacy}","received_events_url":"https://api.github.com/users/siddharth19/received_events","type":"User","site_admin":false},"created_at":"2018-06-16T08:33:48Z","updated_at":"2018-06-16T08:33:48Z","author_association":"NONE","body":"I have a Tesla K20Xm which has a compute capability of 3.5. \r\n"}}
{"actor":{"display_login":"siddharth19"}}