diff --git a/bestla/CMakeLists.txt b/bestla/CMakeLists.txt index c07ac66dc..ebd8852fd 100644 --- a/bestla/CMakeLists.txt +++ b/bestla/CMakeLists.txt @@ -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) @@ -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) diff --git a/bestla/CMakePresets.json b/bestla/CMakePresets.json index 0b5cfed75..3fa3071ae 100644 --- a/bestla/CMakePresets.json +++ b/bestla/CMakePresets.json @@ -1,4 +1,4 @@ -{ +{ "version": 3, "configurePresets": [ { @@ -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", @@ -25,7 +27,7 @@ "inherits": "linux-debug", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", - "JBLAS_UT_ALL": "ON" + "BTLA_UT_ALL": "ON" } }, { @@ -33,10 +35,7 @@ "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", @@ -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", @@ -67,7 +66,8 @@ }, "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", - "JBLAS_UT_DEBUG": "ON" + "BTLA_UT_DEBUG": "ON", + "BTLA_UT_ALL": "OFF" } }, { @@ -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" } } ] -} \ No newline at end of file +} diff --git a/bestla/bestla/bestla_storage.h b/bestla/bestla/bestla_storage.h index 5f4993f72..2cad50fa1 100644 --- a/bestla/bestla/bestla_storage.h +++ b/bestla/bestla/bestla_storage.h @@ -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(serialized_buf); + auto tmpptr=const_cast(serialized_buf); + auto rptr = reinterpret_cast(tmpptr); rptr += IWeightBase::offset(); int mProID = utils::deserialize(rptr); IWeightBase* ptr = NULL; if (mProID >= int(BTLA_PROLOGUEB_IDS::Begin) && mProID < int(BTLA_PROLOGUEB_IDS::End)) { - rptr = reinterpret_cast(serialized_buf); + rptr = reinterpret_cast(tmpptr); auto type = static_cast(mProID); switch (type) { case BTLA_PROLOGUEB_IDS::WeightPack: