File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,21 @@ else()
26
26
endif ()
27
27
28
28
if (NOT DEFINED ENV{runtime_include_dir} )
29
- message (
30
- STATUS
31
- "set runtime_include_dir: ${CMAKE_SOURCE_DIR} /paddle/cinn/runtime/cuda" )
32
- set (ENV{runtime_include_dir} "${CMAKE_SOURCE_DIR} /paddle/cinn/runtime/cuda" )
33
- add_definitions (
34
- -DRUNTIME_INCLUDE_DIR= "${CMAKE_SOURCE_DIR} /paddle/cinn/runtime/cuda" )
29
+ if (WITH_GPU )
30
+ message (
31
+ STATUS
32
+ "set runtime_include_dir: ${CMAKE_SOURCE_DIR} /paddle/cinn/runtime/cuda" )
33
+ set (ENV{runtime_include_dir} "${CMAKE_SOURCE_DIR} /paddle/cinn/runtime/cuda" )
34
+ add_definitions (
35
+ -DRUNTIME_INCLUDE_DIR= "${CMAKE_SOURCE_DIR} /paddle/cinn/runtime/cuda" )
36
+ elseif (WITH_ROCM )
37
+ message (
38
+ STATUS
39
+ "set runtime_include_dir: ${CMAKE_SOURCE_DIR} /paddle/cinn/runtime/hip" )
40
+ set (ENV{runtime_include_dir} "${CMAKE_SOURCE_DIR} /paddle/cinn/runtime/hip" )
41
+ add_definitions (
42
+ -DRUNTIME_INCLUDE_DIR= "${CMAKE_SOURCE_DIR} /paddle/cinn/runtime/hip" )
43
+ endif ()
35
44
endif ()
36
45
37
46
if (WITH_TESTING )
@@ -118,6 +127,10 @@ if(WITH_ROCM)
118
127
add_definitions (-DCINN_WITH_HIP )
119
128
endif ()
120
129
link_libraries (${ROCM_HIPRTC_LIB} )
130
+
131
+ message (
132
+ STATUS "copy paddle/cinn/common/float16.h to $ENV{runtime_include_dir} " )
133
+ file (COPY paddle/cinn/common/float16.h DESTINATION $ENV{runtime_include_dir} )
121
134
endif ()
122
135
123
136
set (cinnapi_src CACHE INTERNAL "" FORCE )
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ if '${WITH_GPU}' == 'ON':
156
156
157
157
if '${WITH_ROCM}' == 'ON':
158
158
cinnlibs.append('${CMAKE_BINARY_DIR}/dist/cinn/include/paddle/cinn/runtime/hip/cinn_hip_runtime_source.h')
159
+ cinnlibs.append('${CMAKE_BINARY_DIR}/dist/cinn/include/paddle/cinn/runtime/hip/float16.h')
159
160
160
161
if '${CINN_WITH_SYCL}' == 'ON':
161
162
cinnlibs.append('${CMAKE_BINARY_DIR}/dist/cinn/include/paddle/cinn/runtime/sycl/cinn_sycl_runtime_source.h')
You can’t perform that action at this time.
0 commit comments