Skip to content

Commit

Permalink
conform to daal ABI
Browse files Browse the repository at this point in the history
  • Loading branch information
icfaust committed Mar 2, 2025
1 parent cd80c9e commit b59671d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 38 deletions.
40 changes: 21 additions & 19 deletions cpp/daal/src/algorithms/kernel_inst_arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Mode, ContainerTemplate<__VA_ARGS__, sve> 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<Mode, ContainerTemplate<__VA_ARGS__, sve> 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<Mode, ContainerTemplate<__VA_ARGS__, sve> 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<Mode, ContainerTemplate<__VA_ARGS__, sve> DAAL_KERNEL_SVE_CONTAINER(ContainerTemplate, __VA_ARGS__)>; \
}

#endif
40 changes: 21 additions & 19 deletions cpp/daal/src/algorithms/kernel_inst_riscv64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Mode, ContainerTemplate<__VA_ARGS__, rv64> 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<Mode, ContainerTemplate<__VA_ARGS__, rv64> 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<Mode, ContainerTemplate<__VA_ARGS__, rv64> 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<Mode, ContainerTemplate<__VA_ARGS__, rv64> DAAL_KERNEL_RV64_CONTAINER(ContainerTemplate, __VA_ARGS__)>; \
}

#endif

0 comments on commit b59671d

Please sign in to comment.