From b59671d62fda4513522503d191bda1be71103b6f Mon Sep 17 00:00:00 2001 From: icfaust Date: Sun, 2 Mar 2025 06:22:30 -0800 Subject: [PATCH] conform to daal ABI --- cpp/daal/src/algorithms/kernel_inst_arm.h | 40 ++++++++++--------- cpp/daal/src/algorithms/kernel_inst_riscv64.h | 40 ++++++++++--------- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/cpp/daal/src/algorithms/kernel_inst_arm.h b/cpp/daal/src/algorithms/kernel_inst_arm.h index 12b48bc460d..3a428c72c5c 100644 --- a/cpp/daal/src/algorithms/kernel_inst_arm.h +++ b/cpp/daal/src/algorithms/kernel_inst_arm.h @@ -20,27 +20,29 @@ // The defines used for kernel allocation, deallocation, and calling kernel methods //-- */ +#include "services/daal_defines.h" +//useage of DAAL_EXPORT is only to not break ABI. It can be removed in the next major release (2026.0) #ifndef __KERNEL_INST_ARM_H__ -#define __KERNEL_INST_ARM_H__ + #define __KERNEL_INST_ARM_H__ -#define __DAAL_INSTANTIATE_DISPATCH_IMPL(ContainerTemplate, Mode, ClassName, BaseClassName, GetCpuid, ...) \ - DAAL_KERNEL_SVE_CONTAINER1(ContainerTemplate, __VA_ARGS__) \ - namespace interface1 \ - { \ - template <> \ - ClassName DAAL_KERNEL_SVE_CONTAINER(ContainerTemplate, __VA_ARGS__)>::ClassName( \ - daal::services::Environment::env * daalEnv) \ - : BaseClassName(daalEnv), _cntr(nullptr) \ - { \ - GetCpuid switch (__DAAL_KERNEL_MIN(DAAL_KERNEL_BUILD_MAX_INSTRUCTION_SET_ID, cpuid)) \ - { \ - DAAL_KERNEL_SVE_CONTAINER_CASE(ContainerTemplate, __VA_ARGS__) \ - default: _cntr = (new ContainerTemplate<__VA_ARGS__, sve>(daalEnv)); break; \ - } \ - } \ - \ - template class ClassName DAAL_KERNEL_SVE_CONTAINER(ContainerTemplate, __VA_ARGS__)>; \ - } + #define __DAAL_INSTANTIATE_DISPATCH_IMPL(ContainerTemplate, Mode, ClassName, BaseClassName, GetCpuid, ...) \ + DAAL_KERNEL_SVE_CONTAINER1(ContainerTemplate, __VA_ARGS__) \ + namespace interface1 \ + { \ + template <> \ + DAAL_EXPORT ClassName DAAL_KERNEL_SVE_CONTAINER(ContainerTemplate, __VA_ARGS__)>::ClassName( \ + daal::services::Environment::env * daalEnv) \ + : BaseClassName(daalEnv), _cntr(nullptr) \ + { \ + GetCpuid switch (__DAAL_KERNEL_MIN(DAAL_KERNEL_BUILD_MAX_INSTRUCTION_SET_ID, cpuid)) \ + { \ + DAAL_KERNEL_SVE_CONTAINER_CASE(ContainerTemplate, __VA_ARGS__) \ + default: _cntr = (new ContainerTemplate<__VA_ARGS__, sve>(daalEnv)); break; \ + } \ + } \ + \ + template class ClassName DAAL_KERNEL_SVE_CONTAINER(ContainerTemplate, __VA_ARGS__)>; \ + } #endif diff --git a/cpp/daal/src/algorithms/kernel_inst_riscv64.h b/cpp/daal/src/algorithms/kernel_inst_riscv64.h index f127c80ef1f..06b10afa4a9 100644 --- a/cpp/daal/src/algorithms/kernel_inst_riscv64.h +++ b/cpp/daal/src/algorithms/kernel_inst_riscv64.h @@ -20,27 +20,29 @@ // The defines used for kernel allocation, deallocation, and calling kernel methods //-- */ +#include "services/daal_defines.h" +//useage of DAAL_EXPORT is only to not break ABI. It can be removed in the next major release (2026.0) #ifndef __KERNEL_INST_RISCV64_H__ -#define __KERNEL_INST_RISCV64_H__ + #define __KERNEL_INST_RISCV64_H__ -#define __DAAL_INSTANTIATE_DISPATCH_IMPL(ContainerTemplate, Mode, ClassName, BaseClassName, GetCpuid, ...) \ - DAAL_KERNEL_RV64_CONTAINER1(ContainerTemplate, __VA_ARGS__) \ - namespace interface1 \ - { \ - template <> \ - ClassName DAAL_KERNEL_RV64_CONTAINER(ContainerTemplate, __VA_ARGS__)>::ClassName( \ - daal::services::Environment::env * daalEnv) \ - : BaseClassName(daalEnv), _cntr(nullptr) \ - { \ - GetCpuid switch (__DAAL_KERNEL_MIN(DAAL_KERNEL_BUILD_MAX_INSTRUCTION_SET_ID, cpuid)) \ - { \ - DAAL_KERNEL_RV64_CONTAINER_CASE(ContainerTemplate, __VA_ARGS__) \ - default: _cntr = (new ContainerTemplate<__VA_ARGS__, rv64>(daalEnv)); break; \ - } \ - } \ - \ - template class ClassName DAAL_KERNEL_RV64_CONTAINER(ContainerTemplate, __VA_ARGS__)>; \ - } + #define __DAAL_INSTANTIATE_DISPATCH_IMPL(ContainerTemplate, Mode, ClassName, BaseClassName, GetCpuid, ...) \ + DAAL_KERNEL_RV64_CONTAINER1(ContainerTemplate, __VA_ARGS__) \ + namespace interface1 \ + { \ + template <> \ + DAAL_EXPORT ClassName DAAL_KERNEL_RV64_CONTAINER(ContainerTemplate, __VA_ARGS__)>::ClassName( \ + daal::services::Environment::env * daalEnv) \ + : BaseClassName(daalEnv), _cntr(nullptr) \ + { \ + GetCpuid switch (__DAAL_KERNEL_MIN(DAAL_KERNEL_BUILD_MAX_INSTRUCTION_SET_ID, cpuid)) \ + { \ + DAAL_KERNEL_RV64_CONTAINER_CASE(ContainerTemplate, __VA_ARGS__) \ + default: _cntr = (new ContainerTemplate<__VA_ARGS__, rv64>(daalEnv)); break; \ + } \ + } \ + \ + template class ClassName DAAL_KERNEL_RV64_CONTAINER(ContainerTemplate, __VA_ARGS__)>; \ + } #endif