Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
make UT OFF as default. (#25)
Browse files Browse the repository at this point in the history
* make UT OFF as default.

* change pointer to const void*
  • Loading branch information
luoyu-intel authored Jan 5, 2024
1 parent 1bc0530 commit 9e20bd1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions bestla/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ file(GLOB headers ${PROJECT_NAME}/*.h ${PROJECT_NAME}/*.hpp)
file(GLOB xbyak_headers ${PROJECT_NAME}/xbyak/*.h ${PROJECT_NAME}/xbyak/*.hpp)

option(BTLA_UT_ALL "Enable all unit tests" OFF)
option(BTLA_UT_DEBUG "Enable debug unit tests" ON)
option(BTLA_UT_DEBUG "Enable debug unit tests" OFF)
option(BTLA_UT_EPILOGUE "Enable unit test for epilogue" OFF)
option(BTLA_UT_PROLOGUE_A "Enable unit test for activation prologue" OFF)
option(BTLA_UT_PROLOGUE_B "Enable unit test for weight prologue" OFF)
Expand Down Expand Up @@ -110,7 +110,7 @@ if(UT_BUILD)
add_executable(${PROJECT_NAME}_ut ${srcs} ${headers} ${ut_headers})
if(BTLA_UT_OPENMP)
include(FindOpenMP)
target_link_libraries(${PROJECT_NAME}_ut PRIVATE OpenMP::OpenMP_CXX OpenMP::OpenMP_C)
target_link_libraries(${PROJECT_NAME}_ut PRIVATE OpenMP::OpenMP_CXX)
endif()
if(NOT WIN32)
if(NOT BTLA_UT_NOASAN)
Expand Down
22 changes: 11 additions & 11 deletions bestla/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"version": 3,
"configurePresets": [
{
Expand All @@ -9,7 +9,9 @@
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
"CMAKE_BUILD_TYPE": "Debug",
"BTLA_UT_DEBUG": "ON",
"BTLA_UT_ALL": "OFF"
},
"condition": {
"type": "equals",
Expand All @@ -25,18 +27,15 @@
"inherits": "linux-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"JBLAS_UT_ALL": "ON"
"BTLA_UT_ALL": "ON"
}
},
{
"name": "linux-release",
"displayName": "linux Release",
"description": "Release",
"inherits": "linux-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"JBLAS_UT_ALL": "OFF"
}
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }
},
{
"name": "windows-base",
Expand All @@ -48,7 +47,7 @@
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe",
"JBLAS_UT_ALL": "OFF"
"BTLA_UT_ALL": "OFF"
},
"condition": {
"type": "equals",
Expand All @@ -67,7 +66,8 @@
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"JBLAS_UT_DEBUG": "ON"
"BTLA_UT_DEBUG": "ON",
"BTLA_UT_ALL": "OFF"
}
},
{
Expand All @@ -82,7 +82,7 @@
"displayName": "x64 Release for UT",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (RelWithDebInfo)",
"inherits": "x64-release",
"cacheVariables": { "JBLAS_UT_ALL": "ON" }
"cacheVariables": { "BTLA_UT_ALL": "ON" }
}
]
}
}
7 changes: 4 additions & 3 deletions bestla/bestla/bestla_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -792,16 +792,17 @@ class StorageWeightKBlockNFloat : public StorageWeightKBlockNInteger {

class PackedWeightParser {
public:
static gemm::IWeightBase* deserialBuffer(void* serialized_buf) {
static gemm::IWeightBase* deserialBuffer(const void* serialized_buf) {
if (serialized_buf == nullptr) {
return nullptr;
}
auto rptr = reinterpret_cast<int8_t*>(serialized_buf);
auto tmpptr=const_cast<void*>(serialized_buf);
auto rptr = reinterpret_cast<int8_t*>(tmpptr);
rptr += IWeightBase::offset();
int mProID = utils::deserialize<int>(rptr);
IWeightBase* ptr = NULL;
if (mProID >= int(BTLA_PROLOGUEB_IDS::Begin) && mProID < int(BTLA_PROLOGUEB_IDS::End)) {
rptr = reinterpret_cast<int8_t*>(serialized_buf);
rptr = reinterpret_cast<int8_t*>(tmpptr);
auto type = static_cast<BTLA_PROLOGUEB_IDS>(mProID);
switch (type) {
case BTLA_PROLOGUEB_IDS::WeightPack:
Expand Down

0 comments on commit 9e20bd1

Please sign in to comment.