File tree 4 files changed +39
-0
lines changed
4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.16.0)
2
+
3
+ project (static_libs)
4
+ set (HIP_CXX_COMPILER "/opt/rocm/llvm/bin/clang++" )
5
+ set (CMAKE_CXX_COMPILER ${HIP_CXX_COMPILER} CACHE FILEPATH "" FORCE)
6
+ set (CMAKE_CXX_STANDARD "17" CACHE STRING "" FORCE)
7
+
8
+ message (STATUS "HIP_COMPILER: ${HIP_COMPILER} " )
9
+ message (STATUS "HIP_CXX_COMPILER: ${HIP_CXX_COMPILER} " )
10
+
11
+ set (GPU_ARCH_OPTS "--offload-arch=gfx900" )
12
+ set (HIP_COMPILE_OPTS "-xhip" )
13
+ set (HIP_LINK_RT_OPTS "--hip-link" )
14
+ set (HIP_RDC "-fgpu-rdc" )
15
+
16
+ add_library (a STATIC a.cpp)
17
+ target_compile_options (a PRIVATE ${HIP_COMPILE_OPTS} ${GPU_ARCH_OPTS} ${HIP_RDC} )
18
+
19
+ add_executable (p p.cpp)
20
+ target_compile_options (p PRIVATE ${HIP_COMPILE_OPTS} ${GPU_ARCH_OPTS} ${HIP_RDC} )
21
+ target_link_libraries (p a)
22
+ target_link_options (p PRIVATE ${HIP_LINK_RT_OPTS} ${GPU_ARCH_OPTS} ${HIP_RDC} )
Original file line number Diff line number Diff line change
1
+ #include " a.hpp"
2
+
3
+ #include " hip/hip_runtime.h"
4
+
5
+ __global__ void kernel_a_0 () {
6
+
7
+ }
Original file line number Diff line number Diff line change
1
+
2
+ extern " C" __global__ void kernel_a_0 ();
Original file line number Diff line number Diff line change
1
+
2
+ #include " hip/hip_runtime.h"
3
+ #include " a.hpp"
4
+
5
+ int main () {
6
+ kernel_a_0<<<1 ,1 ,1 >>>();
7
+ return 0 ;
8
+ }
You can’t perform that action at this time.
0 commit comments