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)
467
467
if (GPU_LANGUAGE STREQUAL "HIP" )
468
468
# Make this target dependent on the hipify preprocessor step.
469
469
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} )
470
476
endif ()
471
477
472
478
if (GPU_ARCHITECTURES )
@@ -482,8 +488,6 @@ function (define_gpu_extension_target GPU_MOD_NAME)
482
488
target_compile_definitions (${GPU_MOD_NAME} PRIVATE
483
489
"-DTORCH_EXTENSION_NAME=${GPU_MOD_NAME} " )
484
490
485
- target_include_directories (${GPU_MOD_NAME} PRIVATE csrc
486
- ${GPU_INCLUDE_DIRECTORIES} )
487
491
488
492
target_link_libraries (${GPU_MOD_NAME} PRIVATE torch ${GPU_LIBRARIES} )
489
493
You can’t perform that action at this time.
0 commit comments