Skip to content

Commit 2b138f4

Browse files
Adding mathlib include paths
1 parent 65e402e commit 2b138f4

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

caffe2/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,13 +1373,6 @@ if(USE_ROCM)
13731373
set(ROCM_SOURCE_DIR "/opt/rocm")
13741374
endif()
13751375
message(INFO "caffe2 ROCM_SOURCE_DIR = ${ROCM_SOURCE_DIR}")
1376-
target_include_directories(torch_hip PRIVATE
1377-
${ROCM_SOURCE_DIR}/include
1378-
${ROCM_SOURCE_DIR}/hcc/include
1379-
${ROCM_SOURCE_DIR}/rocblas/include
1380-
${ROCM_SOURCE_DIR}/hipsparse/include
1381-
${ROCM_SOURCE_DIR}/include/rccl/
1382-
)
13831376
if(USE_FLASH_ATTENTION)
13841377
target_compile_definitions(torch_hip PRIVATE
13851378
USE_FLASH_ATTENTION
@@ -1713,7 +1706,7 @@ if(USE_ROCM)
17131706
target_link_libraries(torch_hip PRIVATE ${Caffe2_HIP_DEPENDENCY_LIBS})
17141707

17151708
# Since PyTorch files contain HIP headers, this is also needed to capture the includes.
1716-
target_include_directories(torch_hip PRIVATE ${Caffe2_HIP_INCLUDE})
1709+
target_include_directories(torch_hip PRIVATE ${Caffe2_HIP_INCLUDE} ${ROCM_INCLUDE})
17171710
target_include_directories(torch_hip INTERFACE $<INSTALL_INTERFACE:include>)
17181711
endif()
17191712

cmake/public/LoadHIP.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ if(HIP_FOUND)
165165
endif()
166166
find_package_and_print_version(hipblaslt REQUIRED)
167167

168+
list(APPEND ROCM_INCLUDE ${rocthrust_INCLUDE_DIR})
169+
list(APPEND ROCM_INCLUDE ${rocprim_INCLUDE_DIR})
170+
list(APPEND ROCM_INCLUDE ${hipcub_INCLUDE_DIR})
171+
list(APPEND ROCM_INCLUDE ${rocRAND_INCLUDE_DIR})
172+
list(APPEND ROCM_INCLUDE ${INTERFACE_INCLUDE_DIRECTORIES})
173+
168174
if(UNIX)
169175
find_package_and_print_version(rccl)
170176
find_package_and_print_version(hsa-runtime64 REQUIRED)

0 commit comments

Comments
 (0)