File: CMakeLists.txt

package info (click to toggle)
pytorch 1.7.1-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 80,340 kB
  • sloc: cpp: 670,830; python: 343,991; ansic: 67,845; asm: 5,503; sh: 2,924; java: 2,888; xml: 266; makefile: 244; ruby: 148; yacc: 144; objc: 51; lex: 44
file content (88 lines) | stat: -rw-r--r-- 2,663 bytes parent folder | download
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
if((NOT BUILD_CAFFE2) OR (INTERN_BUILD_MOBILE AND NOT BUILD_CAFFE2_MOBILE))
  list(APPEND Caffe2_CPU_SRCS
    utils/string_utils.cc
    utils/threadpool/pthreadpool-cpp.cc
    utils/threadpool/ThreadPool.cc
  )
  if(NOT BUILD_CAFFE2)
    list(APPEND Caffe2_CPU_SRCS
      utils/proto_wrap.cc
    )
  endif()
  set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} PARENT_SCOPE)
  return()
endif()

list(APPEND Caffe2_CPU_SRCS
  utils/bench_utils.cc
  utils/cpuid.cc
  utils/math/broadcast.cc
  utils/math/elementwise.cc
  utils/math/reduce.cc
  utils/math/transpose.cc
  utils/math/utils.cc
  utils/math_cpu.cc
  utils/murmur_hash3.cc
  utils/proto_convert.cc
  utils/proto_utils.cc
  utils/proto_wrap.cc
  utils/threadpool/ThreadPool.cc
  utils/signal_handler.cc
  utils/smart_tensor_printer.cc
  utils/string_utils.cc)

if(USE_PTHREADPOOL)
  list(APPEND Caffe2_CPU_SRCS
    utils/threadpool/pthreadpool-cpp.cc)
  if(USE_INTERNAL_PTHREADPOOL_IMPL)
    list(APPEND Caffe2_CPU_SRCS
      utils/threadpool/pthreadpool.cc
      utils/threadpool/pthreadpool_impl.cc)
  endif()
endif()

set(Caffe2_GPU_SRCS ${Caffe2_GPU_SRCS}
        utils/math/broadcast.cu
        utils/math/elementwise.cu
        utils/math/reduce.cu
        utils/math/transpose.cu
        utils/math_gpu.cu
        )

set(Caffe2_HIP_SRCS ${Caffe2_HIP_SRCS}
        utils/math/hip/broadcast.hip
        utils/math/hip/elementwise.hip
        utils/math/hip/reduce.hip
        utils/math/hip/transpose.hip
        utils/hip/math_gpu.hip
        )

set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS}
        utils/fixed_divisor_test.cc
        utils/math_test.cc
        utils/fatal_signal_asan_no_sig_test.cc
        utils/simple_queue_test.cc
        utils/proto_utils_test.cc
        utils/cpuid_test.cc
        utils/smart_tensor_printer_test.cc
        utils/cast_test.cc
        )

set(Caffe2_GPU_TEST_SRCS ${Caffe2_GPU_TEST_SRCS}
        utils/math_gpu_test.cc
        )

set(Caffe2_HIP_TEST_SRCS ${Caffe2_HIP_TEST_SRCS}
        utils/hip/math_gpu_test.cc
        utils/hip/math_blas_gpu_test.cc
        )

# TODO Once all source files are defined inside the local c10_utils_xxx targets,
# it should be the job of the parent CMakeLists.txt to decide what to do with the target (i.e. link it to caffe2)
# instead of us locally adding it to Caffe2_xxx variables.
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)