CMakeLists.txt 3.07 KB
Newer Older
Paul's avatar
Paul committed
1

Paul's avatar
Paul committed
2
3
include(ROCMInstallTargets)
include(ROCMPackageConfigHelpers)
4
include(RegisterOp)
Paul's avatar
Paul committed
5

Paul's avatar
Paul committed
6
add_library(migraphx 
Paul's avatar
Paul committed
7
    auto_contiguous.cpp
Paul's avatar
Paul committed
8
    eliminate_common_subexpression.cpp
9
    decompose.cpp
Paul's avatar
Paul committed
10
    propagate_constant.cpp
Paul's avatar
Paul committed
11
    dead_code_elimination.cpp
Paul's avatar
Paul committed
12
    eliminate_allocation.cpp
13
    eliminate_contiguous.cpp
14
    eliminate_concat.cpp
15
    eliminate_identity.cpp
16
    eliminate_pad.cpp
Paul's avatar
Paul committed
17
    rewrite_batchnorm.cpp
Shucai Xiao's avatar
Shucai Xiao committed
18
    rewrite_rnn.cpp
19
    rewrite_pooling.cpp
Paul's avatar
Paul committed
20
    env.cpp
Paul's avatar
Paul committed
21
    generate.cpp
Paul's avatar
Paul committed
22
    instruction.cpp
23
    msgpack.cpp
Paul's avatar
Paul committed
24
    program.cpp
Shucai Xiao's avatar
Shucai Xiao committed
25
    quantization.cpp
26
    reduce_dims.cpp
27
    remap.cpp
Paul's avatar
Paul committed
28
    shape.cpp
Paul's avatar
Paul committed
29
    schedule.cpp
30
    serialize.cpp
31
    pass_manager.cpp
32
    register_op.cpp
Paul's avatar
Paul committed
33
    simplify_algebra.cpp
Paul's avatar
Paul committed
34
    simplify_reshapes.cpp
35
    value.cpp
Shucai Xiao's avatar
Shucai Xiao committed
36
    json.cpp
mei-ye's avatar
mei-ye committed
37
38
    opt/memory_coloring.cpp
    opt/memory_coloring_impl.cpp
Paul's avatar
Paul committed
39
)
Paul's avatar
Paul committed
40
rocm_set_soversion(migraphx ${MIGRAPHX_SO_VERSION})
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
function(register_migraphx_ops)
    foreach(OP ${ARGN})
        register_op(migraphx HEADER migraphx/op/${OP}.hpp OPERATORS op::${OP})
    endforeach()
endfunction()
register_migraphx_ops(
    abs
    acosh
    acos
    add
    argmax
    argmin
    asinh
    asin
    as_shape
    atanh
    atan
    batch_norm_inference
    broadcast
    capture
    ceil
    clip
    concat
    contiguous
    convert
    convolution
    cosh
    cos
    deconvolution
    div
    dot
    elu
    erf
    exp
    flatten
    floor
    gather
    gru
    identity
    im2col
    leaky_relu
    load
    log
    logsoftmax
    lrn
    lstm
    max
    min
    mul
    multibroadcast
    neg
    outline
    pad
    pooling
    pow
    prelu
    quant_convolution
    quant_dot
    recip
    reduce_max
    reduce_mean
    reduce_min
    reduce_prod
    reduce_sum
    relu
    reshape
    rnn
    rnn_last_cell_output
    rnn_last_hs_output
    rnn_var_sl_last_output
    round
    rsqrt
    scalar
    sigmoid
    sign
    sinh
    sin
    slice
    softmax
    sqdiff
    sqrt
    squeeze
    sub
    tanh
    tan
    transpose
    undefined
    unknown
    unsqueeze
)
register_op(migraphx HEADER migraphx/op/rnn_variable_seq_lens.hpp OPERATORS op::rnn_var_sl_shift_output op::rnn_var_sl_shift_sequence)
register_op(migraphx HEADER migraphx/builtin.hpp OPERATORS builtin::literal builtin::param builtin::returns)
Paul's avatar
Paul committed
133
rocm_clang_tidy_check(migraphx)
Paul's avatar
Paul committed
134
rocm_install_targets(
Paul's avatar
Paul committed
135
  TARGETS migraphx
Paul's avatar
Paul committed
136
137
138
  INCLUDE
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)
Paul's avatar
Paul committed
139

Paul's avatar
Paul committed
140
find_path(HALF_INCLUDE_DIR half.hpp)
Paul's avatar
Paul committed
141
# TODO: Fix the incorrect path
Paul's avatar
Paul committed
142
target_include_directories(migraphx SYSTEM PUBLIC $<BUILD_INTERFACE:${HALF_INCLUDE_DIR}>)
Paul's avatar
Paul committed
143

144
145
146
147
148
find_package(msgpack REQUIRED)
target_link_libraries(migraphx PRIVATE msgpackc-cxx)
# Make this available to the tests
target_link_libraries(migraphx INTERFACE $<BUILD_INTERFACE:msgpackc-cxx>)

Paul's avatar
Paul committed
149
set(PACKAGE_DEPENDS)
Paul's avatar
Paul committed
150

Paul Fultz II's avatar
Paul Fultz II committed
151
add_subdirectory(api)
Paul's avatar
Paul committed
152
add_subdirectory(driver)
Paul's avatar
Paul committed
153
add_subdirectory(onnx)
Khalique's avatar
Khalique committed
154
add_subdirectory(tf)
Khalique's avatar
Khalique committed
155

Paul's avatar
Paul committed
156
add_subdirectory(py)
Paul's avatar
Paul committed
157
add_subdirectory(targets/cpu)
Paul's avatar
Paul committed
158
if(MIGRAPHX_ENABLE_GPU)
Paul Fultz II's avatar
Paul Fultz II committed
159
list(APPEND PACKAGE_DEPENDS PACKAGE MIOpen PACKAGE rocblas)
Paul's avatar
Paul committed
160
add_subdirectory(targets/gpu)
Paul's avatar
Paul committed
161
endif()
mei-ye's avatar
mei-ye committed
162

Paul's avatar
Paul committed
163
rocm_export_targets(
Paul's avatar
Paul committed
164
165
  TARGETS migraphx::migraphx
  NAMESPACE migraphx::
Paul's avatar
Paul committed
166
167
168
  DEPENDS
    ${PACKAGE_DEPENDS}
)
mei-ye's avatar
mei-ye committed
169
170