Skip to content

Commit 7f82d74

Browse files
committed
fix: 去掉 cncl 编译
1 parent 02939c9 commit 7f82d74

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ if (USE_BANG)
6161
find_library(CAMBRICON_CNNL libcnnl.so "${NEUWARE_HOME}/lib64")
6262
find_library(CAMBRICON_CNRT libcnrt.so "${NEUWARE_HOME}/lib64")
6363
find_library(CAMBRICON_CNDRV libcndrv.so "${NEUWARE_HOME}/lib64")
64-
find_library(CAMBRICON_CNCL libcncl.so "${NEUWARE_HOME}/lib64")
65-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lstdc++ -Wall -Werror")
64+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lstdc++ -Wall")
6665

6766
if ((NOT DEFINED TARGET_CPU_ARCH) AND (NOT DEFINED ENV{TARGET_CPU_ARCH}))
6867
execute_process(COMMAND uname -m OUTPUT_VARIABLE _uname_m OUTPUT_STRIP_TRAILING_WHITESPACE)

src/02hardware/src/devices/mlu/functions.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
namespace refactor::hardware {
44

55
int getDeviceCount() {
6-
int deviceCount;
6+
unsigned deviceCount;
77
BANG_ASSERT(cnrtGetDeviceCount(&deviceCount));
8-
return deviceCount;
8+
return static_cast<int>(deviceCount);
99
}
1010
void setDevice(int device) {
1111
BANG_ASSERT(cnrtSetDevice(device));
1212
}
1313
MemInfo getMemInfo() {
1414
MemInfo memInfo;
15-
BANG_ASSERT(cudaMemGetInfo(&memInfo.free, &memInfo.total));
15+
BANG_ASSERT(cnrtMemGetInfo(&memInfo.free, &memInfo.total));
1616
return memInfo;
1717
}
1818

src/02hardware/src/devices/mlu/functions.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef HARDWARE_DEVICES_MLU_FUNCTIONS_CUH
22
#define HARDWARE_DEVICES_MLU_FUNCTIONS_CUH
33

4+
#include "cnrt.h"
45
#include "common.h"
56

67
#define BANG_ASSERT(STATUS) \

src/04kernel/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if(USE_KUNLUN)
3636
target_link_libraries(kernel PUBLIC ${KUNLUN_RT} ${KUNLUN_DNN})
3737
endif()
3838
if(USE_BANG)
39-
target_link_libraries(kernel ${CAMBRICON_CNCL} ${CAMBRICON_CNNL} ${CAMBRICON_CNRT} ${CAMBRICON_CNDRV} stdc++)
39+
target_link_libraries(kernel PUBLIC ${CAMBRICON_CNNL} ${CAMBRICON_CNRT} ${CAMBRICON_CNDRV})
4040
endif()
4141

4242
file(GLOB_RECURSE KERNEL_TEST test/*.cpp)

0 commit comments

Comments
 (0)