Skip to content

Commit 1ca6675

Browse files
Unireversedongchengwei
andauthored
[Feature](mlu-ops): Add mtp_617 compile options. (Cambricon#1288)
Co-authored-by: dongchengwei <dongchengwei@cambricon.com>
1 parent 83fee7c commit 1ca6675

6 files changed

Lines changed: 20 additions & 11 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ endif()
140140
if (NOT MLUOP_MLU_ARCH_LIST)
141141
message(STATUS "build all arch")
142142
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS}" "--bang-mlu-arch=mtp_592"
143-
"--bang-mlu-arch=mtp_613")
143+
"--bang-mlu-arch=mtp_613"
144+
"--bang-mlu-arch=mtp_617")
144145
else()
145146
foreach (arch ${MLUOP_MLU_ARCH_LIST})
146147
set(CNCC_FLAGS_ARCH ${CNCC_FLAGS_ARCH} "--bang-mlu-arch=${arch}" )

independent_build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ add_mlu_arch_support () {
7272
--mtp613)
7373
bang_arch="mtp_613;"
7474
;;
75+
--mtp617)
76+
bang_arch="mtp_617;"
77+
;;
7578
*)
7679
;;
7780
esac

kernels/fft/common/fft_common_kernels.mlu

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,12 @@ __mlu_func__ void selectVec(float *src_addr, int32_t *offset_int_addr,
107107
float *dst_addr, int deal_size) {
108108
#if __BANG_ARCH__ >= 372 && __BANG_ARCH__ != 520
109109
__asm__ volatile(
110-
"gather.clean.nram.nram.nram.b32.u32 "
111-
"[%[dst]], [%[src]], [%[offset]], %[data_num];\n\t" ::[dst] "r"(dst_addr),
112-
[src] "r"(src_addr), [offset] "r"(offset_int_addr),
113-
[data_num] "r"(deal_size));
110+
"gather.vector.nram.nram.nram.u32 "
111+
"[%[dst]], [%[src]], [%[offset]], %[transfer_size], %[transfer_num], %[stride];\n\t"
112+
::[dst] "r"(dst_addr),
113+
[src] "r"(src_addr), [offset] "r"(offset_int_addr),
114+
[transfer_size] "i"(4), [transfer_num] "r"(deal_size),
115+
[stride] "i"(4));
114116
#else
115117
for (auto i = 0; i < deal_size; i++) {
116118
dst_addr[i] = src_addr[offset_int_addr[i]];

samples/mlu-ops/abs_sample/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ endif()
4646
# setup cncc flags
4747
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS} -fPIC -Wall -Werror -std=c++11 -pthread")
4848
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS} -O3")
49-
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS}" "--bang-mlu-arch=mtp_372"
50-
"--bang-mlu-arch=mtp_592"
49+
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS}" "--bang-mlu-arch=mtp_592"
50+
"--bang-mlu-arch=mtp_613"
51+
"--bang-mlu-arch=mtp_617"
5152
)
5253

5354
# build project

samples/mlu-ops/fault_sample/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ endif()
4545
# setup cncc flags
4646
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS} -fPIC -Wall -Werror -std=c++11 -pthread")
4747
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS} -O3")
48-
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS}" "--bang-mlu-arch=mtp_372"
49-
"--bang-mlu-arch=mtp_592"
48+
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS}" "--bang-mlu-arch=mtp_592"
49+
"--bang-mlu-arch=mtp_613"
50+
"--bang-mlu-arch=mtp_617"
5051
)
5152

5253
# build project

samples/mlu-ops/poly_nms_sample/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ endif()
4545
# setup cncc flags
4646
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS} -fPIC -Wall -Werror -std=c++11 -pthread")
4747
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS} -O3")
48-
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS}" "--bang-mlu-arch=mtp_372"
49-
"--bang-mlu-arch=mtp_592"
48+
set(BANG_CNCC_FLAGS "${BANG_CNCC_FLAGS}" "--bang-mlu-arch=mtp_592"
49+
"--bang-mlu-arch=mtp_613"
50+
"--bang-mlu-arch=mtp_617"
5051
)
5152

5253
# build project

0 commit comments

Comments
 (0)