File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
02hardware/src/devices/mlu Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff line change 33namespace 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
Original file line number Diff line number Diff line change 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 ) \
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ if(USE_KUNLUN)
3636 target_link_libraries (kernel PUBLIC ${KUNLUN_RT} ${KUNLUN_DNN} )
3737endif ()
3838if (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} )
4040endif ()
4141
4242file (GLOB_RECURSE KERNEL_TEST test /*.cpp)
You can’t perform that action at this time.
0 commit comments