[Bugfix][CI/Build][ROCm] Make sure to use the headers from the build folder on ROCm (#22264)
Signed-off-by: Gregory Shtrasberg <Gregory.Shtrasberg@amd.com>
This commit is contained in:
committed by
GitHub
parent
302962e806
commit
5d5d419ca6
@@ -467,6 +467,12 @@ function (define_gpu_extension_target GPU_MOD_NAME)
|
|||||||
if (GPU_LANGUAGE STREQUAL "HIP")
|
if (GPU_LANGUAGE STREQUAL "HIP")
|
||||||
# Make this target dependent on the hipify preprocessor step.
|
# Make this target dependent on the hipify preprocessor step.
|
||||||
add_dependencies(${GPU_MOD_NAME} hipify${GPU_MOD_NAME})
|
add_dependencies(${GPU_MOD_NAME} hipify${GPU_MOD_NAME})
|
||||||
|
# Make sure we include the hipified versions of the headers, and avoid conflicts with the ones in the original source folder
|
||||||
|
target_include_directories(${GPU_MOD_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/csrc
|
||||||
|
${GPU_INCLUDE_DIRECTORIES})
|
||||||
|
else()
|
||||||
|
target_include_directories(${GPU_MOD_NAME} PRIVATE csrc
|
||||||
|
${GPU_INCLUDE_DIRECTORIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (GPU_ARCHITECTURES)
|
if (GPU_ARCHITECTURES)
|
||||||
@@ -482,8 +488,6 @@ function (define_gpu_extension_target GPU_MOD_NAME)
|
|||||||
target_compile_definitions(${GPU_MOD_NAME} PRIVATE
|
target_compile_definitions(${GPU_MOD_NAME} PRIVATE
|
||||||
"-DTORCH_EXTENSION_NAME=${GPU_MOD_NAME}")
|
"-DTORCH_EXTENSION_NAME=${GPU_MOD_NAME}")
|
||||||
|
|
||||||
target_include_directories(${GPU_MOD_NAME} PRIVATE csrc
|
|
||||||
${GPU_INCLUDE_DIRECTORIES})
|
|
||||||
|
|
||||||
target_link_libraries(${GPU_MOD_NAME} PRIVATE torch ${GPU_LIBRARIES})
|
target_link_libraries(${GPU_MOD_NAME} PRIVATE torch ${GPU_LIBRARIES})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user