File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -467,6 +467,12 @@ function (define_gpu_extension_target GPU_MOD_NAME)
467467 if (GPU_LANGUAGE STREQUAL "HIP" )
468468 # Make this target dependent on the hipify preprocessor step.
469469 add_dependencies (${GPU_MOD_NAME} hipify${GPU_MOD_NAME} )
470+ # Make sure we include the hipified versions of the headers, and avoid conflicts with the ones in the original source folder
471+ target_include_directories (${GPU_MOD_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR} /csrc
472+ ${GPU_INCLUDE_DIRECTORIES} )
473+ else ()
474+ target_include_directories (${GPU_MOD_NAME} PRIVATE csrc
475+ ${GPU_INCLUDE_DIRECTORIES} )
470476 endif ()
471477
472478 if (GPU_ARCHITECTURES)
@@ -482,8 +488,6 @@ function (define_gpu_extension_target GPU_MOD_NAME)
482488 target_compile_definitions (${GPU_MOD_NAME} PRIVATE
483489 "-DTORCH_EXTENSION_NAME=${GPU_MOD_NAME} " )
484490
485- target_include_directories (${GPU_MOD_NAME} PRIVATE csrc
486- ${GPU_INCLUDE_DIRECTORIES} )
487491
488492 target_link_libraries (${GPU_MOD_NAME} PRIVATE torch ${GPU_LIBRARIES} )
489493
You can’t perform that action at this time.
0 commit comments