forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
166 lines (157 loc) · 6.33 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
set(ATen_CUDA_INCLUDE ${ATen_CUDA_INCLUDE}
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}"
PARENT_SCOPE)
configure_file(THCGeneral.h.in "${CMAKE_CURRENT_BINARY_DIR}/THCGeneral.h")
set(extra_src)
# loop over all types
foreach(THC_TYPE Byte Char Short Int Long Half Float Double)
# loop over files which need to be split between types (because of long compile times)
foreach(THC_FILE TensorSort TensorMathPointwise TensorMathReduce TensorMasked TensorTopK)
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/generated/THC${THC_FILE}${THC_TYPE}.cu")
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/generated/THC${THC_FILE}${THC_TYPE}.cu"
"#include <THC/THC${THC_FILE}.cuh>\n#include <THC/THCTensor.hpp>\n\n#include <THC/generic/THC${THC_FILE}.cu>\n#include <THC/THCGenerate${THC_TYPE}Type.h>\n")
endif()
list(APPEND extra_src "${CMAKE_CURRENT_SOURCE_DIR}/generated/THC${THC_FILE}${THC_TYPE}.cu")
endforeach()
endforeach()
foreach(THC_FILE TensorMathPointwise TensorMathReduce TensorMasked)
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/generated/THC${THC_FILE}Bool.cu")
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/generated/THC${THC_FILE}Bool.cu"
"#include <THC/THC${THC_FILE}.cuh>\n#include <THC/THCTensor.hpp>\n\n#include <THC/generic/THC${THC_FILE}.cu>\n#include <THC/THCGenerateBoolType.h>\n")
endif()
list(APPEND extra_src "${CMAKE_CURRENT_SOURCE_DIR}/generated/THC${THC_FILE}Bool.cu")
endforeach()
foreach(THC_FILE TensorMathReduce TensorMasked TensorSort TensorTopK)
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/generated/THC${THC_FILE}BFloat16.cu")
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/generated/THC${THC_FILE}BFloat16.cu"
"#include <THC/THC${THC_FILE}.cuh>\n#include <THC/THCTensor.hpp>\n\n#include <THC/generic/THC${THC_FILE}.cu>\n#include <THC/THCGenerateBFloat16Type.h>\n")
endif()
list(APPEND extra_src "${CMAKE_CURRENT_SOURCE_DIR}/generated/THC${THC_FILE}BFloat16.cu")
endforeach()
set(ATen_CUDA_SRCS ${ATen_CUDA_SRCS}
${CMAKE_CURRENT_SOURCE_DIR}/THCCachingHostAllocator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/THCGeneral.cpp
${CMAKE_CURRENT_SOURCE_DIR}/THCStorageCopy.cpp
${CMAKE_CURRENT_SOURCE_DIR}/THCTensor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/THCReduceApplyUtils.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCBlas.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCSleep.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCStorage.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCStorageCopy.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensor.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorCopy.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMath.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMathBlas.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMathMagma.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMathPairwise.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMathReduce.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorIndex.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorRandom.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorScatterGather.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorSort.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCSortUtils.cu
${extra_src}
PARENT_SCOPE)
set(ATen_CUDA_SRCS_W_SORT_BY_KEY ${ATen_CUDA_SRCS_W_SORT_BY_KEY}
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMode.cu
PARENT_SCOPE)
install(FILES
THC.h
${CMAKE_CURRENT_BINARY_DIR}/THCGeneral.h
THCGeneral.hpp
THCBlas.h
THCSleep.h
THCStorage.h
THCStorageCopy.h
THCTensor.h
THCTensorCopy.h
THCTensorCopy.hpp
THCTensorRandom.h
THCTensorMath.h
THCApply.cuh
THCReduce.cuh
THCReduceAll.cuh
THCReduceApplyUtils.cuh
THCTensorMathReduce.cuh
THCAsmUtils.cuh
THCAtomics.cuh
THCScanUtils.cuh
THCSortUtils.cuh
THCAllocator.h
THCCachingHostAllocator.h
THCDeviceUtils.cuh
THCDeviceTensor.cuh
THCDeviceTensor-inl.cuh
THCDeviceTensorUtils.cuh
THCDeviceTensorUtils-inl.cuh
THCGenerateAllTypes.h
THCGenerateBFloat16Type.h
THCGenerateBoolType.h
THCGenerateByteType.h
THCGenerateCharType.h
THCGenerateShortType.h
THCGenerateIntType.h
THCGenerateLongType.h
THCGenerateHalfType.h
THCGenerateFloatType.h
THCGenerateFloatTypes.h
THCGenerateDoubleType.h
THCGenerateComplexFloatType.h
THCGenerateComplexTypes.h
THCGenerateComplexDoubleType.h
THCIntegerDivider.cuh
THCNumerics.cuh
THCTensorSort.cuh
THCTensorInfo.cuh
THCTensorMathPointwise.cuh
THCTensorTypeUtils.cuh
THCTensorRandom.cuh
THCTensorMathMagma.cuh
THCThrustAllocator.cuh
THCTensorMode.cuh
THCTensorTopK.cuh
# See Note [TH abstraction violation]
THCTensor.hpp
THCStorage.hpp
DESTINATION "${ATEN_INSTALL_INCLUDE_SUBDIR}/THC")
install(FILES
generic/THCStorage.cpp
generic/THCStorage.cu
generic/THCStorage.h
generic/THCTensor.cpp
generic/THCTensor.cu
generic/THCTensor.h
generic/THCTensor.hpp
generic/THCStorageCopy.cpp
generic/THCStorageCopy.cu
generic/THCStorageCopy.h
generic/THCTensorCopy.cu
generic/THCTensorCopy.h
generic/THCTensorMasked.h
generic/THCTensorMasked.cu
generic/THCTensorMath.h
generic/THCTensorMath.cu
generic/THCTensorMathBlas.cu
generic/THCTensorMathBlas.h
generic/THCTensorMathMagma.h
generic/THCTensorMathMagma.cu
generic/THCTensorMathPairwise.h
generic/THCTensorMathPairwise.cu
generic/THCTensorMathPointwise.h
generic/THCTensorMathPointwise.cu
generic/THCTensorMathReduce.h
generic/THCTensorMathReduce.cu
generic/THCTensorScatterGather.h
generic/THCTensorScatterGather.cu
generic/THCTensorIndex.h
generic/THCTensorIndex.cu
generic/THCTensorSort.h
generic/THCTensorSort.cu
generic/THCTensorRandom.h
generic/THCTensorRandom.cu
generic/THCTensorMode.h
generic/THCTensorMode.cu
generic/THCTensorTopK.h
generic/THCTensorTopK.cu
DESTINATION "${ATEN_INSTALL_INCLUDE_SUBDIR}/THC/generic")