Skip to content

Commit 0d7a986

Browse files
bddppqfacebook-github-bot
authored andcommitted
Change hip filename extension to .hip (pytorch#14036)
Summary: xw285cornell - To make hip files to have unique filename extension we change hip files from _hip.cc to .hip (it's the only blessing option other than .cu in hipcc https://github.com/ROCm-Developer-Tools/HIP/blob/3d51a1fb0105e2f2312d2523c20e0034339f6ada/bin/hipcc#L552). - Change to use host compiler to compile .cc|.cpp files. Previously we use hcc to compile them which is unnecessary - Change the hipify script to not replace "gpu" with "hip" in the filename of the generated hipified files. Previously we do this because hcc has a bug when linking files that have same filename. We have now changed to use host linker to do linking so this is unnecessary anymore. Pull Request resolved: pytorch#14036 Reviewed By: xw285cornell Differential Revision: D13091813 Pulled By: bddppq fbshipit-source-id: ea3d887751d8abb39d75f5d5104aa66ce66b9ee0
1 parent 30018fc commit 0d7a986

35 files changed

+145
-160
lines changed

binaries/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ if (USE_CUDA)
2424
endif()
2525

2626
if (USE_ROCM)
27-
caffe2_hip_binary_target("hip/inspect_hip.cc")
28-
caffe2_hip_binary_target("hip/print_core_object_sizes_hip.cc")
27+
caffe2_hip_binary_target("hip/inspect_gpu.cc")
28+
caffe2_hip_binary_target("hip/print_core_object_sizes_gpu.cc")
2929

3030
if (BUILD_TEST)
3131
# Core overhead benchmark
32-
caffe2_hip_binary_target("hip/core_overhead_benchmark_hip.cc")
33-
target_link_libraries(core_overhead_benchmark_hip benchmark)
32+
caffe2_hip_binary_target("hip/core_overhead_benchmark_gpu.cc")
33+
target_link_libraries(core_overhead_benchmark_gpu benchmark)
3434
endif()
3535
endif()
3636

caffe2/CMakeLists.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,14 @@ if(USE_ROCM)
374374
# Call again since Caffe2_HIP_INCLUDES is extended with ATen include dirs.
375375
hip_include_directories(${Caffe2_HIP_INCLUDES})
376376

377-
filter_list(__caffe2_hip_srcs_cpp Caffe2_HIP_SRCS "\\.(cc|cpp|cu)$")
377+
filter_list(__caffe2_hip_srcs_cpp Caffe2_HIP_SRCS "\\.(cu|hip)$")
378378
set_source_files_properties(${__caffe2_hip_srcs_cpp} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
379379

380380
# FindHIP.CMake checks if the SHARED flag is set and adds extra logic accordingly.
381381
hip_add_library(caffe2_hip ${Caffe2_HIP_SRCS})
382382

383383
# Since PyTorch files contain HIP headers, these flags are required for the necessary definitions to be added.
384-
target_compile_options(caffe2_hip PRIVATE ${HIP_HCC_FLAGS})
384+
target_compile_options(caffe2_hip PRIVATE ${HIP_CXX_FLAGS})
385385
target_link_libraries(caffe2_hip PUBLIC caffe2)
386386
target_link_libraries(caffe2_hip PUBLIC ${Caffe2_HIP_DEPENDENCY_LIBS})
387387

@@ -435,7 +435,6 @@ if (BUILD_TEST)
435435

436436
if(USE_ROCM)
437437
foreach(test_src ${Caffe2_HIP_TEST_SRCS})
438-
set_source_files_properties(${test_src} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
439438
get_filename_component(test_name ${test_src} NAME_WE)
440439
add_executable(${test_name} "${test_src}")
441440
target_link_libraries(${test_name} ${Caffe2_MAIN_LIBS} gtest_main)

caffe2/core/CMakeLists.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS} ${tmp})
1414
file(GLOB tmp *_test.cc)
1515
exclude(Caffe2_GPU_SRCS "${Caffe2_GPU_SRCS}" ${tmp})
1616

17-
# ---[ HIP files
18-
file(GLOB_RECURSE tmp *_hip.cc)
17+
# ---[ general HIP files
18+
file(GLOB tmp hip/*.cc)
1919
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
20-
# ------[ MIOpen files
21-
file(GLOB_RECURSE tmp *_miopen.cc)
20+
# ------[ HIP sources
21+
file(GLOB tmp hip/*.hip)
2222
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
2323
# exclude test files
24-
file(GLOB_RECURSE tmp *_test.cc)
24+
file(GLOB tmp hip/*_test.cc)
2525
exclude(Caffe2_HIP_SRCS "${Caffe2_HIP_SRCS}" ${tmp})
2626

2727
# ---[ CPU files.
@@ -42,7 +42,7 @@ file(GLOB tmp *_gpu_test.cc)
4242
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} ${tmp})
4343

4444
# ---[ HIP test files
45-
file(GLOB_RECURSE tmp *_hip_test.cc)
45+
file(GLOB tmp hip/*_test.cc)
4646
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} ${tmp})
4747

4848
# ---[ CPU test files

caffe2/core/common_gpu.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void DeviceQuery(const int device) {
194194
<< std::endl;
195195
ss << "Total registers per block: " << prop.regsPerBlock << std::endl;
196196
ss << "Warp size: " << prop.warpSize << std::endl;
197-
#ifndef __HIPCC__
197+
#ifndef __HIP_PLATFORM_HCC__
198198
ss << "Maximum memory pitch: " << prop.memPitch << std::endl;
199199
#endif
200200
ss << "Maximum threads per block: " << prop.maxThreadsPerBlock
@@ -207,14 +207,14 @@ void DeviceQuery(const int device) {
207207
<< prop.maxGridSize[2] << std::endl;
208208
ss << "Clock rate: " << prop.clockRate << std::endl;
209209
ss << "Total constant memory: " << prop.totalConstMem << std::endl;
210-
#ifndef __HIPCC__
210+
#ifndef __HIP_PLATFORM_HCC__
211211
ss << "Texture alignment: " << prop.textureAlignment << std::endl;
212212
ss << "Concurrent copy and execution: "
213213
<< (prop.deviceOverlap ? "Yes" : "No") << std::endl;
214214
#endif
215215
ss << "Number of multiprocessors: " << prop.multiProcessorCount
216216
<< std::endl;
217-
#ifndef __HIPCC__
217+
#ifndef __HIP_PLATFORM_HCC__
218218
ss << "Kernel execution timeout: "
219219
<< (prop.kernelExecTimeoutEnabled ? "Yes" : "No") << std::endl;
220220
#endif
@@ -266,7 +266,7 @@ const char* cublasGetErrorString(cublasStatus_t error) {
266266
return "CUBLAS_STATUS_INVALID_VALUE";
267267
case CUBLAS_STATUS_ARCH_MISMATCH:
268268
return "CUBLAS_STATUS_ARCH_MISMATCH";
269-
#ifndef __HIPCC__
269+
#ifndef __HIP_PLATFORM_HCC__
270270
case CUBLAS_STATUS_MAPPING_ERROR:
271271
return "CUBLAS_STATUS_MAPPING_ERROR";
272272
case CUBLAS_STATUS_EXECUTION_FAILED:
@@ -282,7 +282,7 @@ const char* cublasGetErrorString(cublasStatus_t error) {
282282
return "CUBLAS_STATUS_LICENSE_ERROR";
283283
#endif // CUDA_VERSION >= 6050
284284
#endif // CUDA_VERSION >= 6000
285-
#ifdef __HIPCC__
285+
#ifdef __HIP_PLATFORM_HCC__
286286
case rocblas_status_invalid_size:
287287
return "rocblas_status_invalid_size";
288288
#endif
@@ -319,7 +319,7 @@ const char* curandGetErrorString(curandStatus_t error) {
319319
return "CURAND_STATUS_ARCH_MISMATCH";
320320
case CURAND_STATUS_INTERNAL_ERROR:
321321
return "CURAND_STATUS_INTERNAL_ERROR";
322-
#ifdef __HIPCC__
322+
#ifdef __HIP_PLATFORM_HCC__
323323
case HIPRAND_STATUS_NOT_IMPLEMENTED:
324324
return "HIPRAND_STATUS_NOT_IMPLEMENTED";
325325
#endif

caffe2/core/common_gpu.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ CAFFE2_CUDA_API const char* curandGetErrorString(curandStatus_t error);
282282
// CUDA_KERNEL_ASSERT is a macro that wraps an assert() call inside cuda
283283
// kernels. This is not supported by Apple platforms so we special case it.
284284
// See http://docs.nvidia.com/cuda/cuda-c-programming-guide/#assertion
285-
#if defined(__APPLE__) || defined(__HIPCC__)
285+
#if defined(__APPLE__) || defined(__HIP_PLATFORM_HCC__)
286286
#define CUDA_KERNEL_ASSERT(...)
287287
#else // __APPLE__
288288
#define CUDA_KERNEL_ASSERT(...) assert(__VA_ARGS__)
File renamed without changes.

caffe2/core/hip/miopen_wrapper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define CAFFE2_CORE_MIOPEN_WRAPPERS_H_
44

55
#include "caffe2/core/hip/common_miopen.h"
6-
#include "caffe2/core/hip/context_hip.h"
6+
#include "caffe2/core/hip/context_gpu.h"
77

88
namespace caffe2 {
99

caffe2/db/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ set(Caffe2_DB_COMMON_GPU_SRC
66
"${CMAKE_CURRENT_SOURCE_DIR}/create_db_op_gpu.cc"
77
)
88
set(Caffe2_DB_COMMON_HIP_SRC
9-
"${CMAKE_CURRENT_SOURCE_DIR}/hip/create_db_op_hip.cc"
9+
"${CMAKE_CURRENT_SOURCE_DIR}/hip/create_db_op_gpu.cc"
1010
)
1111

1212
# Common files that are always going to be included.
1313
list(APPEND Caffe2_CPU_SRCS ${Caffe2_DB_COMMON_CPU_SRC})
1414
list(APPEND Caffe2_GPU_SRCS ${Caffe2_DB_COMMON_GPU_SRC})
15-
list(APPEND Caffe2_HIP_SRCS ${Caffe2_DB_COMMON_HIP_SRC})
15+
list(APPEND Caffe2_HIP_SRCS ${Caffe2_DB_COMMON_HIP_SRC})
1616

1717
# DB specific files
1818
if (USE_LMDB)

caffe2/image/CMakeLists.txt

+9-6
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ if(USE_OPENCV AND OpenCV_FOUND)
1212
exclude(Caffe2_GPU_SRCS "${Caffe2_GPU_SRCS}" ${tmp})
1313

1414
# ---[ HIP files
15-
# ------[ general hip
16-
file(GLOB_RECURSE tmp *_hip.cc)
15+
# ------[ general HIP
16+
file(GLOB tmp hip/*.cc)
17+
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
18+
# ------[ HIP sources
19+
file(GLOB tmp hip/*.hip)
1720
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
1821
# exclude test files
19-
file(GLOB_RECURSE tmp *_test.cc)
22+
file(GLOB tmp hip/*_test.cc)
2023
exclude(Caffe2_HIP_SRCS "${Caffe2_HIP_SRCS}" ${tmp})
21-
24+
2225
# ---[ CPU files.
2326
file(GLOB tmp *.cc)
2427
set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} ${tmp})
@@ -33,9 +36,9 @@ if(USE_OPENCV AND OpenCV_FOUND)
3336
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} ${tmp})
3437

3538
# ---[ HIP test files
36-
file(GLOB_RECURSE tmp *_hip_test.cc)
39+
file(GLOB tmp hip/*_test.cc)
3740
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} ${tmp})
38-
41+
3942
# ---[ CPU test files
4043
file(GLOB tmp *_test.cc)
4144
set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})

caffe2/operators/CMakeLists.txt

+8-11
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS} ${tmp})
2323
file(GLOB tmp *_test.cc)
2424
exclude(Caffe2_GPU_SRCS "${Caffe2_GPU_SRCS}" ${tmp})
2525

26-
# ------[ HIP sources
27-
file(GLOB_RECURSE tmp *_hip.cc)
28-
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
29-
# ------[ HIP device sources
30-
file(GLOB_RECURSE tmp *_hipdev.cc)
26+
# ------[ general HIP
27+
file(GLOB tmp hip/*.cc)
3128
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
32-
# ---[ MIOPEN files
33-
file(GLOB_RECURSE tmp *_miopen.cc)
29+
# ------[ HIP sources
30+
file(GLOB tmp hip/*.hip)
3431
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
32+
# exclude test files
33+
file(GLOB tmp hip/*_test.cc)
34+
exclude(Caffe2_HIP_SRCS "${Caffe2_HIP_SRCS}" ${tmp})
3535

3636
# ---[ CPU files.
3737
file(GLOB tmp *.cc)
@@ -58,10 +58,7 @@ file(GLOB tmp *_gpu_test.cc)
5858
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} ${tmp})
5959

6060
# ---[ HIP test files
61-
file(GLOB_RECURSE tmp *_hip_test.cc)
62-
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} ${tmp})
63-
# ---[ MIOPEN test files
64-
file(GLOB_RECURSE tmp *_miopen_test.cc)
61+
file(GLOB tmp hip/*_test.cc)
6562
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} ${tmp})
6663

6764
# ---[ CPU test files

caffe2/operators/hip/activation_ops_miopen.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef CAFFE2_OPERATORS_ACTIVATION_OPS_MIOPEN_H_
22
#define CAFFE2_OPERATORS_ACTIVATION_OPS_MIOPEN_H_
33

4-
#include "caffe2/core/hip/context_hip.h"
4+
#include "caffe2/core/hip/context_gpu.h"
55
#include "caffe2/core/hip/miopen_wrapper.h"
66
#include "caffe2/core/operator.h"
77
#include "caffe2/core/tensor.h"

caffe2/operators/hip/conv_op_miopen.cc renamed to caffe2/operators/hip/conv_op_miopen.hip

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "caffe2/core/hip/context_hip.h"
17+
#include "caffe2/core/hip/context_gpu.h"
1818
#include "caffe2/core/hip/miopen_wrapper.h"
1919
#include "caffe2/operators/conv_op.h"
2020
#include "caffe2/operators/conv_pool_op_base.h"

caffe2/operators/hip/conv_transpose_op_miopen.cc renamed to caffe2/operators/hip/conv_transpose_op_miopen.hip

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "caffe2/core/hip/context_hip.h"
1+
#include "caffe2/core/hip/context_gpu.h"
22
#include "caffe2/core/hip/miopen_wrapper.h"
33
#include "caffe2/operators/conv_transpose_op.h"
44

caffe2/operators/hip/local_response_normalization_op_miopen.cc renamed to caffe2/operators/hip/local_response_normalization_op_miopen.hip

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
#include "caffe2/core/hip/context_hip.h"
16+
#include "caffe2/core/hip/context_gpu.h"
1717
#include "caffe2/core/hip/miopen_wrapper.h"
1818
#include "caffe2/core/operator.h"
1919
#include "caffe2/core/types.h"

caffe2/operators/hip/pool_op_miopen.cc renamed to caffe2/operators/hip/pool_op_miopen.hip

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "caffe2/core/hip/context_hip.h"
17+
#include "caffe2/core/hip/context_gpu.h"
1818
#include "caffe2/core/hip/miopen_wrapper.h"
1919
#include "caffe2/operators/conv_pool_op_base.h"
2020

caffe2/operators/hip/spatial_batch_norm_op_miopen.cc renamed to caffe2/operators/hip/spatial_batch_norm_op_miopen.hip

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616

1717
#include <cfloat>
18-
#include "caffe2/core/hip/context_hip.h"
18+
#include "caffe2/core/hip/context_gpu.h"
1919
#include "caffe2/core/hip/miopen_wrapper.h"
2020
#include "caffe2/operators/spatial_batch_norm_op.h"
21-
#include "caffe2/operators/hip/spatial_batch_norm_op_hip_impl.cuh"
21+
#include "caffe2/operators/hip/spatial_batch_norm_op_gpu_impl.cuh"
2222
#include "caffe2/utils/math.h"
2323

2424
const double MIOPEN_BN_MIN_EPSILON = 1e-6;

caffe2/operators/rnn/CMakeLists.txt

+18-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS} ${tmp})
1414
file(GLOB tmp *_test.cc)
1515
exclude(Caffe2_GPU_SRCS "${Caffe2_GPU_SRCS}" ${tmp})
1616

17+
# ------[ general HIP
18+
file(GLOB tmp hip/*.cc)
19+
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
20+
# ------[ HIP sources
21+
file(GLOB tmp hip/*.hip)
22+
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
23+
# exclude test files
24+
file(GLOB tmp hip/*_test.cc)
25+
exclude(Caffe2_HIP_SRCS "${Caffe2_HIP_SRCS}" ${tmp})
26+
1727
# ---[ CPU files.
1828
file(GLOB tmp *.cc)
1929
# Manually remove the cudnn files since we might be using USE_CUDNN=OFF
@@ -24,7 +34,7 @@ set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} ${tmp})
2434
# exclude test files and gpu files
2535
file(GLOB tmp *_test.cc)
2636
exclude(Caffe2_CPU_SRCS "${Caffe2_CPU_SRCS}" ${tmp})
27-
exclude(Caffe2_CPU_SRCS "${Caffe2_CPU_SRCS}" ${Caffe2_GPU_SRCS})
37+
exclude(Caffe2_CPU_SRCS "${Caffe2_CPU_SRCS}" ${Caffe2_GPU_SRCS} ${Caffe2_HIP_SRCS})
2838

2939
# ---[ GPU test files
3040
# ------[ cuDNN
@@ -36,13 +46,19 @@ endif()
3646
file(GLOB tmp *_gpu_test.cc)
3747
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} ${tmp})
3848

49+
# ------[ HIP test files
50+
file(GLOB tmp hip/*_test.cc)
51+
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} ${tmp})
52+
3953
# ---[ CPU test files
4054
file(GLOB tmp *_test.cc)
4155
set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
42-
exclude(Caffe2_CPU_TEST_SRCS "${Caffe2_CPU_TEST_SRCS}" ${Caffe2_GPU_TEST_SRCS})
56+
exclude(Caffe2_CPU_TEST_SRCS "${Caffe2_CPU_TEST_SRCS}" ${Caffe2_GPU_TEST_SRCS} ${Caffe2_HIP_TEST_SRCS})
4357

4458
# ---[ Send the lists to the parent scope.
4559
set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} PARENT_SCOPE)
4660
set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS} PARENT_SCOPE)
61+
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} PARENT_SCOPE)
4762
set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} PARENT_SCOPE)
4863
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} PARENT_SCOPE)
64+
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} PARENT_SCOPE)

caffe2/operators/rnn/hip/recurrent_op_miopen.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define CAFFE2_OPERATORS_RECURRENT_OP_MIOPEN_H_
33

44
#include "caffe2/core/context.h"
5-
#include "caffe2/core/hip/context_hip.h"
5+
#include "caffe2/core/hip/context_gpu.h"
66
#include "caffe2/core/hip/miopen_wrapper.h"
77
#include "caffe2/core/logging.h"
88
#include "caffe2/core/operator.h"

caffe2/python/pybind_state_hip.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include <pybind11/stl.h>
77

88
#include "caffe2/core/hip/common_miopen.h"
9-
#include "caffe2/core/hip/context_hip.h"
10-
#include "caffe2/operators/hip/operator_fallback_hip.h"
9+
#include "caffe2/core/hip/context_gpu.h"
10+
#include "caffe2/operators/hip/operator_fallback_gpu.h"
1111
#include "caffe2/python/pybind_state_registry.h"
1212

1313
namespace caffe2 {

caffe2/queue/CMakeLists.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS} ${tmp})
99
file(GLOB tmp *_test.cc)
1010
exclude(Caffe2_GPU_SRCS "${Caffe2_GPU_SRCS}" ${tmp})
1111

12+
# ------[ general HIP
13+
file(GLOB tmp hip/*.cc)
14+
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
1215
# ---[ HIP files.
13-
file(GLOB_RECURSE tmp *_hip.cc)
16+
file(GLOB tmp hip/*.hip)
1417
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
1518
# exclude test files
16-
file(GLOB tmp *_test.cc)
19+
file(GLOB tmp hip/*_test.cc)
1720
exclude(Caffe2_HIP_SRCS "${Caffe2_HIP_SRCS}" ${tmp})
1821

1922
# ---[ CPU files.
@@ -29,7 +32,7 @@ file(GLOB tmp *_gpu_test.cc)
2932
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} ${tmp})
3033

3134
# ---[ HI test files
32-
file(GLOB_RECURSE tmp *_hip_test.cc)
35+
file(GLOB tmp hip/*_test.cc)
3336
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} ${tmp})
3437

3538
# ---[ CPU test files
@@ -44,4 +47,3 @@ set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} PARENT_SCOPE)
4447
set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} PARENT_SCOPE)
4548
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} PARENT_SCOPE)
4649
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} PARENT_SCOPE)
47-

0 commit comments

Comments
 (0)