Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinicore
Commits
14a53dee
Commit
14a53dee
authored
Jun 30, 2025
by
PanZezhong
Committed by
YdrMaster
Jul 09, 2025
Browse files
issue291/refactor: ENABLE_CUDA_API 宏全部替换为 ENABLE_NVIDIA_API
Signed-off-by:
PanZezhong
<
panzezhong@qiyuanlab.com
>
parent
f3a075b7
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
65 additions
and
73 deletions
+65
-73
src/infiniccl/cuda/infiniccl_cuda.h
src/infiniccl/cuda/infiniccl_cuda.h
+1
-1
src/infiniop/devices/cuda/cuda_kernel_common.cuh
src/infiniop/devices/cuda/cuda_kernel_common.cuh
+1
-1
src/infiniop/devices/handle.cc
src/infiniop/devices/handle.cc
+3
-3
src/infiniop/ops/add/operator.cc
src/infiniop/ops/add/operator.cc
+5
-5
src/infiniop/ops/causal_softmax/cuda/causal_softmax_kernel.cuh
...nfiniop/ops/causal_softmax/cuda/causal_softmax_kernel.cuh
+1
-1
src/infiniop/ops/causal_softmax/operator.cc
src/infiniop/ops/causal_softmax/operator.cc
+5
-5
src/infiniop/ops/clip/operator.cc
src/infiniop/ops/clip/operator.cc
+5
-5
src/infiniop/ops/gemm/operator.cc
src/infiniop/ops/gemm/operator.cc
+5
-5
src/infiniop/ops/mul/operator.cc
src/infiniop/ops/mul/operator.cc
+5
-5
src/infiniop/ops/random_sample/operator.cc
src/infiniop/ops/random_sample/operator.cc
+5
-5
src/infiniop/ops/rearrange/operator.cc
src/infiniop/ops/rearrange/operator.cc
+4
-4
src/infiniop/ops/rms_norm/operator.cc
src/infiniop/ops/rms_norm/operator.cc
+5
-5
src/infiniop/ops/rope/operator.cc
src/infiniop/ops/rope/operator.cc
+8
-15
src/infiniop/ops/sub/operator.cc
src/infiniop/ops/sub/operator.cc
+5
-5
src/infiniop/ops/swiglu/operator.cc
src/infiniop/ops/swiglu/operator.cc
+5
-5
src/infinirt/cuda/infinirt_cuda.cuh
src/infinirt/cuda/infinirt_cuda.cuh
+1
-1
xmake.lua
xmake.lua
+1
-2
No files found.
src/infiniccl/cuda/infiniccl_cuda.h
View file @
14a53dee
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#include "../infiniccl_impl.h"
#include "../infiniccl_impl.h"
// Windows does not support CUDA
// Windows does not support CUDA
#if defined(ENABLE_
CUD
A_API) && defined(ENABLE_CCL) && !defined(_WIN32)
#if defined(ENABLE_
NVIDI
A_API) && defined(ENABLE_CCL) && !defined(_WIN32)
INFINICCL_DEVICE_API_IMPL
(
cuda
)
INFINICCL_DEVICE_API_IMPL
(
cuda
)
#else
#else
INFINICCL_DEVICE_API_NOOP
(
cuda
)
INFINICCL_DEVICE_API_NOOP
(
cuda
)
...
...
src/infiniop/devices/cuda/cuda_kernel_common.cuh
View file @
14a53dee
...
@@ -45,7 +45,7 @@ indexToOffset(
...
@@ -45,7 +45,7 @@ indexToOffset(
}
}
}
// namespace device::cuda
}
// namespace device::cuda
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include <cuda_fp16.h>
#include <cuda_fp16.h>
__forceinline__
__device__
float
__forceinline__
__device__
float
exp_
(
const
float
val
)
{
exp_
(
const
float
val
)
{
...
...
src/infiniop/devices/handle.cc
View file @
14a53dee
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/cpu_handle.h"
#include "cpu/cpu_handle.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/cuda_handle.h"
#include "cuda/cuda_handle.h"
#endif
#endif
#ifdef ENABLE_CAMBRICON_API
#ifdef ENABLE_CAMBRICON_API
...
@@ -41,7 +41,7 @@ __C infiniStatus_t infiniopCreateHandle(infiniopHandle_t *handle_ptr) {
...
@@ -41,7 +41,7 @@ __C infiniStatus_t infiniopCreateHandle(infiniopHandle_t *handle_ptr) {
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
::
nvidia
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
::
nvidia
);
#endif
#endif
#ifdef ENABLE_CAMBRICON_API
#ifdef ENABLE_CAMBRICON_API
...
@@ -78,7 +78,7 @@ __C infiniStatus_t infiniopDestroyHandle(infiniopHandle_t handle) {
...
@@ -78,7 +78,7 @@ __C infiniStatus_t infiniopDestroyHandle(infiniopHandle_t handle) {
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
::
nvidia
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
::
nvidia
);
#endif
#endif
#ifdef ENABLE_CAMBRICON_API
#ifdef ENABLE_CAMBRICON_API
...
...
src/infiniop/ops/add/operator.cc
View file @
14a53dee
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/add_cpu.h"
#include "cpu/add_cpu.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/add_cuda.cuh"
#include "cuda/add_cuda.cuh"
#endif
#endif
...
@@ -30,7 +30,7 @@ __C infiniStatus_t infiniopCreateAddDescriptor(
...
@@ -30,7 +30,7 @@ __C infiniStatus_t infiniopCreateAddDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
@@ -52,7 +52,7 @@ __C infiniStatus_t infiniopGetAddWorkspaceSize(infiniopAddDescriptor_t desc, siz
...
@@ -52,7 +52,7 @@ __C infiniStatus_t infiniopGetAddWorkspaceSize(infiniopAddDescriptor_t desc, siz
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
GET
(
INFINI_DEVICE_CPU
,
cpu
)
GET
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
default:
default:
...
@@ -82,7 +82,7 @@ __C infiniStatus_t infiniopAdd(
...
@@ -82,7 +82,7 @@ __C infiniStatus_t infiniopAdd(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
@@ -106,7 +106,7 @@ infiniopDestroyAddDescriptor(infiniopAddDescriptor_t desc) {
...
@@ -106,7 +106,7 @@ infiniopDestroyAddDescriptor(infiniopAddDescriptor_t desc) {
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
...
src/infiniop/ops/causal_softmax/cuda/causal_softmax_kernel.cuh
View file @
14a53dee
...
@@ -32,7 +32,7 @@ INFINIOP_CUDA_KERNEL causalSoftmax(
...
@@ -32,7 +32,7 @@ INFINIOP_CUDA_KERNEL causalSoftmax(
// 2 | * * * ... * * * |
// 2 | * * * ... * * * |
// height: 3 col_id->
// height: 3 col_id->
if
(
width
+
blockIdx
.
x
>=
threadIdx
.
x
+
height
)
{
if
(
width
+
blockIdx
.
x
>=
threadIdx
.
x
+
height
)
{
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
y
[
col
]
=
exp_
(
x
[
col
]
-
max_
);
y
[
col
]
=
exp_
(
x
[
col
]
-
max_
);
#else
#else
y
[
col
]
=
exp
(
x
[
col
]
-
max_
);
y
[
col
]
=
exp
(
x
[
col
]
-
max_
);
...
...
src/infiniop/ops/causal_softmax/operator.cc
View file @
14a53dee
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/causal_softmax_cpu.h"
#include "cpu/causal_softmax_cpu.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/causal_softmax_cuda.cuh"
#include "cuda/causal_softmax_cuda.cuh"
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -33,7 +33,7 @@ __C infiniStatus_t infiniopCreateCausalSoftmaxDescriptor(
...
@@ -33,7 +33,7 @@ __C infiniStatus_t infiniopCreateCausalSoftmaxDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
)
CREATE
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
)
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -73,7 +73,7 @@ __C infiniStatus_t infiniopGetCausalSoftmaxWorkspaceSize(infiniopCausalSoftmaxDe
...
@@ -73,7 +73,7 @@ __C infiniStatus_t infiniopGetCausalSoftmaxWorkspaceSize(infiniopCausalSoftmaxDe
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
GET
(
INFINI_DEVICE_CPU
,
cpu
)
GET
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
#ifdef ENABLE_CAMBRICON_MLU
#ifdef ENABLE_CAMBRICON_MLU
...
@@ -119,7 +119,7 @@ __C infiniStatus_t infiniopCausalSoftmax(
...
@@ -119,7 +119,7 @@ __C infiniStatus_t infiniopCausalSoftmax(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
)
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
)
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -159,7 +159,7 @@ __C infiniStatus_t infiniopDestroyCausalSoftmaxDescriptor(infiniopCausalSoftmaxD
...
@@ -159,7 +159,7 @@ __C infiniStatus_t infiniopDestroyCausalSoftmaxDescriptor(infiniopCausalSoftmaxD
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DESTROY
(
INFINI_DEVICE_CPU
,
cpu
)
DESTROY
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DESTROY
(
INFINI_DEVICE_NVIDIA
,
cuda
)
DESTROY
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
...
src/infiniop/ops/clip/operator.cc
View file @
14a53dee
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/clip_cpu.h"
#include "cpu/clip_cpu.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/clip_cuda.cuh"
#include "cuda/clip_cuda.cuh"
#endif
#endif
...
@@ -30,7 +30,7 @@ __C infiniStatus_t infiniopCreateClipDescriptor(
...
@@ -30,7 +30,7 @@ __C infiniStatus_t infiniopCreateClipDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
@@ -52,7 +52,7 @@ __C infiniStatus_t infiniopGetClipWorkspaceSize(infiniopClipDescriptor_t desc, s
...
@@ -52,7 +52,7 @@ __C infiniStatus_t infiniopGetClipWorkspaceSize(infiniopClipDescriptor_t desc, s
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
GET
(
INFINI_DEVICE_CPU
,
cpu
)
GET
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
}
}
...
@@ -82,7 +82,7 @@ __C infiniStatus_t infiniopClip(
...
@@ -82,7 +82,7 @@ __C infiniStatus_t infiniopClip(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
@@ -106,7 +106,7 @@ infiniopDestroyClipDescriptor(infiniopClipDescriptor_t desc) {
...
@@ -106,7 +106,7 @@ infiniopDestroyClipDescriptor(infiniopClipDescriptor_t desc) {
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
...
src/infiniop/ops/gemm/operator.cc
View file @
14a53dee
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/gemm_cpu.h"
#include "cpu/gemm_cpu.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/gemm_cuda.cuh"
#include "cuda/gemm_cuda.cuh"
#endif
#endif
#ifdef ENABLE_CAMBRICON_API
#ifdef ENABLE_CAMBRICON_API
...
@@ -45,7 +45,7 @@ __C infiniStatus_t infiniopCreateGemmDescriptor(
...
@@ -45,7 +45,7 @@ __C infiniStatus_t infiniopCreateGemmDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_CAMBRICON_API
#ifdef ENABLE_CAMBRICON_API
...
@@ -87,7 +87,7 @@ infiniopGetGemmWorkspaceSize(
...
@@ -87,7 +87,7 @@ infiniopGetGemmWorkspaceSize(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
GET
(
INFINI_DEVICE_CPU
,
cpu
);
GET
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
);
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_CAMBRICON_API
#ifdef ENABLE_CAMBRICON_API
...
@@ -136,7 +136,7 @@ __C infiniStatus_t infiniopGemm(
...
@@ -136,7 +136,7 @@ __C infiniStatus_t infiniopGemm(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_CAMBRICON_API
#ifdef ENABLE_CAMBRICON_API
...
@@ -175,7 +175,7 @@ infiniopDestroyGemmDescriptor(infiniopGemmDescriptor_t desc) {
...
@@ -175,7 +175,7 @@ infiniopDestroyGemmDescriptor(infiniopGemmDescriptor_t desc) {
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_CAMBRICON_API
#ifdef ENABLE_CAMBRICON_API
...
...
src/infiniop/ops/mul/operator.cc
View file @
14a53dee
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include "cpu/mul_cpu.h"
#include "cpu/mul_cpu.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/mul_cuda.cuh"
#include "cuda/mul_cuda.cuh"
#endif
#endif
...
@@ -31,7 +31,7 @@ __C infiniStatus_t infiniopCreateMulDescriptor(
...
@@ -31,7 +31,7 @@ __C infiniStatus_t infiniopCreateMulDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
@@ -53,7 +53,7 @@ __C infiniStatus_t infiniopGetMulWorkspaceSize(infiniopMulDescriptor_t desc, siz
...
@@ -53,7 +53,7 @@ __C infiniStatus_t infiniopGetMulWorkspaceSize(infiniopMulDescriptor_t desc, siz
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
GET
(
INFINI_DEVICE_CPU
,
cpu
)
GET
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
default:
default:
...
@@ -83,7 +83,7 @@ __C infiniStatus_t infiniopMul(
...
@@ -83,7 +83,7 @@ __C infiniStatus_t infiniopMul(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
@@ -107,7 +107,7 @@ infiniopDestroyMulDescriptor(infiniopMulDescriptor_t desc) {
...
@@ -107,7 +107,7 @@ infiniopDestroyMulDescriptor(infiniopMulDescriptor_t desc) {
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
...
src/infiniop/ops/random_sample/operator.cc
View file @
14a53dee
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/random_sample_cpu.h"
#include "cpu/random_sample_cpu.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/random_sample_cuda.cuh"
#include "cuda/random_sample_cuda.cuh"
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -35,7 +35,7 @@ infiniopCreateRandomSampleDescriptor(
...
@@ -35,7 +35,7 @@ infiniopCreateRandomSampleDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -68,7 +68,7 @@ __C infiniStatus_t infiniopGetRandomSampleWorkspaceSize(
...
@@ -68,7 +68,7 @@ __C infiniStatus_t infiniopGetRandomSampleWorkspaceSize(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
GET
(
INFINI_DEVICE_CPU
,
cpu
);
GET
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
);
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -111,7 +111,7 @@ __C infiniStatus_t infiniopRandomSample(
...
@@ -111,7 +111,7 @@ __C infiniStatus_t infiniopRandomSample(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -141,7 +141,7 @@ __C infiniStatus_t infiniopDestroyRandomSampleDescriptor(
...
@@ -141,7 +141,7 @@ __C infiniStatus_t infiniopDestroyRandomSampleDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
...
src/infiniop/ops/rearrange/operator.cc
View file @
14a53dee
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#include "ascend/rearrange_ascend.h"
#include "ascend/rearrange_ascend.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/rearrange_cuda.cuh"
#include "cuda/rearrange_cuda.cuh"
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -39,7 +39,7 @@ __C infiniStatus_t infiniopCreateRearrangeDescriptor(
...
@@ -39,7 +39,7 @@ __C infiniStatus_t infiniopCreateRearrangeDescriptor(
CREATE
(
INFINI_DEVICE_ASCEND
,
ascend
);
CREATE
(
INFINI_DEVICE_ASCEND
,
ascend
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -72,7 +72,7 @@ __C infiniStatus_t infiniopRearrange(
...
@@ -72,7 +72,7 @@ __C infiniStatus_t infiniopRearrange(
CALCULATE
(
INFINI_DEVICE_ASCEND
,
ascend
);
CALCULATE
(
INFINI_DEVICE_ASCEND
,
ascend
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -103,7 +103,7 @@ __C infiniStatus_t infiniopDestroyRearrangeDescriptor(
...
@@ -103,7 +103,7 @@ __C infiniStatus_t infiniopDestroyRearrangeDescriptor(
DELETE
(
INFINI_DEVICE_ASCEND
,
ascend
);
DELETE
(
INFINI_DEVICE_ASCEND
,
ascend
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
...
src/infiniop/ops/rms_norm/operator.cc
View file @
14a53dee
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/rms_norm_cpu.h"
#include "cpu/rms_norm_cpu.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/rms_norm_cuda.cuh"
#include "cuda/rms_norm_cuda.cuh"
#endif
#endif
#ifdef ENABLE_ASCEND_API
#ifdef ENABLE_ASCEND_API
...
@@ -43,7 +43,7 @@ __C infiniStatus_t infiniopCreateRMSNormDescriptor(
...
@@ -43,7 +43,7 @@ __C infiniStatus_t infiniopCreateRMSNormDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
)
CREATE
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
)
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
#ifdef ENABLE_KUNLUN_API
#ifdef ENABLE_KUNLUN_API
...
@@ -81,7 +81,7 @@ __C infiniStatus_t infiniopGetRMSNormWorkspaceSize(infiniopRMSNormDescriptor_t d
...
@@ -81,7 +81,7 @@ __C infiniStatus_t infiniopGetRMSNormWorkspaceSize(infiniopRMSNormDescriptor_t d
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
GET
(
INFINI_DEVICE_CPU
,
cpu
)
GET
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
#ifdef ENABLE_KUNLUN_API
#ifdef ENABLE_KUNLUN_API
...
@@ -120,7 +120,7 @@ __C infiniStatus_t infiniopRMSNorm(infiniopRMSNormDescriptor_t desc, void *works
...
@@ -120,7 +120,7 @@ __C infiniStatus_t infiniopRMSNorm(infiniopRMSNormDescriptor_t desc, void *works
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
)
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
)
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
#ifdef ENABLE_KUNLUN_API
#ifdef ENABLE_KUNLUN_API
...
@@ -158,7 +158,7 @@ __C infiniStatus_t infiniopDestroyRMSNormDescriptor(infiniopRMSNormDescriptor_t
...
@@ -158,7 +158,7 @@ __C infiniStatus_t infiniopDestroyRMSNormDescriptor(infiniopRMSNormDescriptor_t
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DESTROY
(
INFINI_DEVICE_CPU
,
cpu
)
DESTROY
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DESTROY
(
INFINI_DEVICE_NVIDIA
,
cuda
)
DESTROY
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
#ifdef ENABLE_KUNLUN_API
#ifdef ENABLE_KUNLUN_API
...
...
src/infiniop/ops/rope/operator.cc
View file @
14a53dee
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/rope_cpu.h"
#include "cpu/rope_cpu.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/rope_cuda.cuh"
#include "cuda/rope_cuda.cuh"
#endif
#endif
#ifdef ENABLE_ASCEND_API
#ifdef ENABLE_ASCEND_API
...
@@ -39,12 +39,15 @@ __C infiniStatus_t infiniopCreateRoPEDescriptor(
...
@@ -39,12 +39,15 @@ __C infiniStatus_t infiniopCreateRoPEDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
CREATE
(
INFINI_DEVICE_METAX
,
maca
);
CREATE
(
INFINI_DEVICE_METAX
,
maca
);
#endif
#endif
#ifdef ENABLE_ASCEND_API
CREATE
(
INFINI_DEVICE_ASCEND
,
ascend
);
#endif
#ifdef ENABLE_CAMBRICON_MLU
#ifdef ENABLE_CAMBRICON_MLU
case
DevCambriconMlu
:
{
case
DevCambriconMlu
:
{
return
bangCreateRoPEDescriptor
((
BangHandle_t
)
handle
,
return
bangCreateRoPEDescriptor
((
BangHandle_t
)
handle
,
...
@@ -52,16 +55,6 @@ __C infiniStatus_t infiniopCreateRoPEDescriptor(
...
@@ -52,16 +55,6 @@ __C infiniStatus_t infiniopCreateRoPEDescriptor(
pos_ids
,
sin_table
,
cos_table
);
pos_ids
,
sin_table
,
cos_table
);
}
}
#endif
#endif
#ifdef ENABLE_ASCEND_API
CREATE
(
INFINI_DEVICE_ASCEND
,
ascend
);
#endif
#ifdef ENABLE_METAX_GPU
case
DevMetaxGpu
:
{
return
macaCreateRoPEDescriptor
((
MacaHandle_t
)
handle
,
(
RoPEMacaDescriptor_t
*
)
desc_ptr
,
t
,
pos_ids
,
sin_table
,
cos_table
);
}
#endif
#ifdef ENABLE_MTHREADS_GPU
#ifdef ENABLE_MTHREADS_GPU
case
DevMthreadsGpu
:
{
case
DevMthreadsGpu
:
{
return
musaCreateRoPEDescriptor
((
MusaHandle_t
)
handle
,
return
musaCreateRoPEDescriptor
((
MusaHandle_t
)
handle
,
...
@@ -87,7 +80,7 @@ __C infiniStatus_t infiniopGetRoPEWorkspaceSize(infiniopRoPEDescriptor_t desc,
...
@@ -87,7 +80,7 @@ __C infiniStatus_t infiniopGetRoPEWorkspaceSize(infiniopRoPEDescriptor_t desc,
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
GET
(
INFINI_DEVICE_CPU
,
cpu
);
GET
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
);
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -138,7 +131,7 @@ __C infiniStatus_t infiniopRoPE(
...
@@ -138,7 +131,7 @@ __C infiniStatus_t infiniopRoPE(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
@@ -184,7 +177,7 @@ infiniopDestroyRoPEDescriptor(infiniopRoPEDescriptor_t desc) {
...
@@ -184,7 +177,7 @@ infiniopDestroyRoPEDescriptor(infiniopRoPEDescriptor_t desc) {
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
...
...
src/infiniop/ops/sub/operator.cc
View file @
14a53dee
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/sub_cpu.h"
#include "cpu/sub_cpu.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/sub_cuda.cuh"
#include "cuda/sub_cuda.cuh"
#endif
#endif
...
@@ -30,7 +30,7 @@ __C infiniStatus_t infiniopCreateSubDescriptor(
...
@@ -30,7 +30,7 @@ __C infiniStatus_t infiniopCreateSubDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
@@ -52,7 +52,7 @@ __C infiniStatus_t infiniopGetSubWorkspaceSize(infiniopSubDescriptor_t desc, siz
...
@@ -52,7 +52,7 @@ __C infiniStatus_t infiniopGetSubWorkspaceSize(infiniopSubDescriptor_t desc, siz
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
GET
(
INFINI_DEVICE_CPU
,
cpu
)
GET
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
default:
default:
...
@@ -82,7 +82,7 @@ __C infiniStatus_t infiniopSub(
...
@@ -82,7 +82,7 @@ __C infiniStatus_t infiniopSub(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
@@ -106,7 +106,7 @@ infiniopDestroySubDescriptor(infiniopSubDescriptor_t desc) {
...
@@ -106,7 +106,7 @@ infiniopDestroySubDescriptor(infiniopSubDescriptor_t desc) {
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
...
...
src/infiniop/ops/swiglu/operator.cc
View file @
14a53dee
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/swiglu_cpu.h"
#include "cpu/swiglu_cpu.h"
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
#include "cuda/swiglu_cuda.cuh"
#include "cuda/swiglu_cuda.cuh"
#endif
#endif
#ifdef ENABLE_KUNLUN_API
#ifdef ENABLE_KUNLUN_API
...
@@ -39,7 +39,7 @@ __C infiniStatus_t infiniopCreateSwiGLUDescriptor(
...
@@ -39,7 +39,7 @@ __C infiniStatus_t infiniopCreateSwiGLUDescriptor(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
CREATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_KUNLUN_API
#ifdef ENABLE_KUNLUN_API
...
@@ -89,7 +89,7 @@ __C infiniStatus_t infiniopGetSwiGLUWorkspaceSize(infiniopSwiGLUDescriptor_t des
...
@@ -89,7 +89,7 @@ __C infiniStatus_t infiniopGetSwiGLUWorkspaceSize(infiniopSwiGLUDescriptor_t des
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
GET
(
INFINI_DEVICE_CPU
,
cpu
)
GET
(
INFINI_DEVICE_CPU
,
cpu
)
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
GET
(
INFINI_DEVICE_NVIDIA
,
cuda
)
#endif
#endif
#ifdef ENABLE_KUNLUN_API
#ifdef ENABLE_KUNLUN_API
...
@@ -142,7 +142,7 @@ __C infiniStatus_t infiniopSwiGLU(
...
@@ -142,7 +142,7 @@ __C infiniStatus_t infiniopSwiGLU(
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
CALCULATE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_KUNLUN_API
#ifdef ENABLE_KUNLUN_API
...
@@ -188,7 +188,7 @@ infiniopDestroySwiGLUDescriptor(infiniopSwiGLUDescriptor_t desc) {
...
@@ -188,7 +188,7 @@ infiniopDestroySwiGLUDescriptor(infiniopSwiGLUDescriptor_t desc) {
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
DELETE
(
INFINI_DEVICE_CPU
,
cpu
);
#endif
#endif
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
cuda
);
#endif
#endif
#ifdef ENABLE_KUNLUN_API
#ifdef ENABLE_KUNLUN_API
...
...
src/infinirt/cuda/infinirt_cuda.cuh
View file @
14a53dee
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#include "../infinirt_impl.h"
#include "../infinirt_impl.h"
namespace
infinirt
::
cuda
{
namespace
infinirt
::
cuda
{
#ifdef ENABLE_
CUD
A_API
#ifdef ENABLE_
NVIDI
A_API
INFINIRT_DEVICE_API_IMPL
INFINIRT_DEVICE_API_IMPL
#else
#else
INFINIRT_DEVICE_API_NOOP
INFINIRT_DEVICE_API_NOOP
...
...
xmake.lua
View file @
14a53dee
...
@@ -48,7 +48,7 @@ option("nv-gpu")
...
@@ -48,7 +48,7 @@ option("nv-gpu")
option_end
()
option_end
()
if
has_config
(
"nv-gpu"
)
then
if
has_config
(
"nv-gpu"
)
then
add_defines
(
"ENABLE_
CUD
A_API"
)
add_defines
(
"ENABLE_
NVIDI
A_API"
)
includes
(
"xmake/cuda.lua"
)
includes
(
"xmake/cuda.lua"
)
end
end
...
@@ -121,7 +121,6 @@ option("sugon-dcu")
...
@@ -121,7 +121,6 @@ option("sugon-dcu")
option_end
()
option_end
()
if
has_config
(
"sugon-dcu"
)
then
if
has_config
(
"sugon-dcu"
)
then
add_defines
(
"ENABLE_CUDA_API"
)
add_defines
(
"ENABLE_SUGON_CUDA_API"
)
add_defines
(
"ENABLE_SUGON_CUDA_API"
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment