mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
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 3d51a1fb01/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: https://github.com/pytorch/pytorch/pull/14036
Reviewed By: xw285cornell
Differential Revision: D13091813
Pulled By: bddppq
fbshipit-source-id: ea3d887751d8abb39d75f5d5104aa66ce66b9ee0
50 lines
1.6 KiB
CMake
50 lines
1.6 KiB
CMake
# ---[ GPU files
|
|
# ------[ general GPU
|
|
file(GLOB tmp *_gpu.cc)
|
|
set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS} ${tmp})
|
|
# ------[ CUDA sources
|
|
file(GLOB tmp *.cu)
|
|
set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS} ${tmp})
|
|
# exclude test files
|
|
file(GLOB tmp *_test.cc)
|
|
exclude(Caffe2_GPU_SRCS "${Caffe2_GPU_SRCS}" ${tmp})
|
|
|
|
# ------[ general HIP
|
|
file(GLOB tmp hip/*.cc)
|
|
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
|
|
# ---[ HIP files.
|
|
file(GLOB tmp hip/*.hip)
|
|
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} ${tmp})
|
|
# exclude test files
|
|
file(GLOB tmp hip/*_test.cc)
|
|
exclude(Caffe2_HIP_SRCS "${Caffe2_HIP_SRCS}" ${tmp})
|
|
|
|
# ---[ CPU files.
|
|
file(GLOB tmp *.cc)
|
|
set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} ${tmp})
|
|
# exclude test, gpu and hip files
|
|
file(GLOB tmp *_test.cc)
|
|
exclude(Caffe2_CPU_SRCS "${Caffe2_CPU_SRCS}" ${tmp})
|
|
exclude(Caffe2_CPU_SRCS "${Caffe2_CPU_SRCS}" ${Caffe2_GPU_SRCS} ${Caffe2_HIP_SRCS})
|
|
|
|
# ---[ GPU test files
|
|
file(GLOB tmp *_gpu_test.cc)
|
|
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} ${tmp})
|
|
|
|
# ---[ HI test files
|
|
file(GLOB tmp hip/*_test.cc)
|
|
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} ${tmp})
|
|
|
|
# ---[ CPU test files
|
|
file(GLOB tmp *_test.cc)
|
|
set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
|
|
exclude(Caffe2_CPU_TEST_SRCS "${Caffe2_CPU_TEST_SRCS}" ${Caffe2_GPU_TEST_SRCS} ${Caffe2_HIP_TEST_SRCS})
|
|
|
|
# ---[ Send the lists to the parent scope.
|
|
set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} PARENT_SCOPE)
|
|
set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS} PARENT_SCOPE)
|
|
set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS} PARENT_SCOPE)
|
|
set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} PARENT_SCOPE)
|
|
set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS} PARENT_SCOPE)
|
|
set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS} PARENT_SCOPE)
|