Unverified Commit 95623d82 authored by PanZezhong1725's avatar PanZezhong1725 Committed by GitHub
Browse files

Merge pull request #328 from YdrMaster/main

issue/158/refactor: 分离天数和英伟达的算子定义
parents e3022fa8 d9de5133
...@@ -38,7 +38,7 @@ infiniStatus_t streamSynchronize(infinirtStream_t stream) { ...@@ -38,7 +38,7 @@ infiniStatus_t streamSynchronize(infinirtStream_t stream) {
} }
infiniStatus_t streamWaitEvent(infinirtStream_t stream, infinirtEvent_t event) { infiniStatus_t streamWaitEvent(infinirtStream_t stream, infinirtEvent_t event) {
#ifdef ENABLE_ILUVATAR_CUDA_API #ifdef ENABLE_ILUVATAR_API
return INFINI_STATUS_NOT_IMPLEMENTED; return INFINI_STATUS_NOT_IMPLEMENTED;
#else #else
CHECK_CUDART(cudaStreamWaitEvent((cudaStream_t)stream, (cudaEvent_t)event)); CHECK_CUDART(cudaStreamWaitEvent((cudaStream_t)stream, (cudaEvent_t)event));
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "../infinirt_impl.h" #include "../infinirt_impl.h"
namespace infinirt::cuda { namespace infinirt::cuda {
#ifdef ENABLE_NVIDIA_API #if defined(ENABLE_NVIDIA_API) || defined(ENABLE_ILUVATAR_API)
INFINIRT_DEVICE_API_IMPL INFINIRT_DEVICE_API_IMPL
#else #else
INFINIRT_DEVICE_API_NOOP INFINIRT_DEVICE_API_NOOP
......
...@@ -262,6 +262,11 @@ def get_args(): ...@@ -262,6 +262,11 @@ def get_args():
action="store_true", action="store_true",
help="Run NVIDIA GPU test", help="Run NVIDIA GPU test",
) )
parser.add_argument(
"--iluvatar",
action="store_true",
help="Run Iluvatar GPU test",
)
parser.add_argument( parser.add_argument(
"--cambricon", "--cambricon",
action="store_true", action="store_true",
...@@ -566,6 +571,8 @@ def get_test_devices(args): ...@@ -566,6 +571,8 @@ def get_test_devices(args):
devices_to_test.append(InfiniDeviceEnum.CPU) devices_to_test.append(InfiniDeviceEnum.CPU)
if args.nvidia: if args.nvidia:
devices_to_test.append(InfiniDeviceEnum.NVIDIA) devices_to_test.append(InfiniDeviceEnum.NVIDIA)
if args.iluvatar:
devices_to_test.append(InfiniDeviceEnum.ILUVATAR)
if args.cambricon: if args.cambricon:
import torch_mlu import torch_mlu
......
...@@ -94,8 +94,7 @@ option("iluvatar-gpu") ...@@ -94,8 +94,7 @@ option("iluvatar-gpu")
option_end() option_end()
if has_config("iluvatar-gpu") then if has_config("iluvatar-gpu") then
add_defines("ENABLE_NVIDIA_API") add_defines("ENABLE_ILUVATAR_API")
add_defines("ENABLE_ILUVATAR_CUDA_API")
includes("xmake/iluvatar.lua") includes("xmake/iluvatar.lua")
end end
......
...@@ -42,12 +42,13 @@ target("infiniop-iluvatar") ...@@ -42,12 +42,13 @@ target("infiniop-iluvatar")
add_links("cudart", "cublas", "cudnn") add_links("cudart", "cublas", "cudnn")
set_warnings("all", "error") set_warnings("all", "error")
add_cuflags("-Wno-error=unused-private-field")
add_cuflags("-fPIC", "-x", "ivcore", "-std=c++17", {force = true}) add_cuflags("-fPIC", "-x", "ivcore", "-std=c++17", {force = true})
add_culdflags("-fPIC") add_culdflags("-fPIC")
add_cxflags("-fPIC") add_cxflags("-fPIC")
-- set_languages("cxx17") 天数似乎不能用这个配置 -- set_languages("cxx17") 天数似乎不能用这个配置
add_files("../src/infiniop/devices/cuda/*.cu", "../src/infiniop/ops/*/cuda/*.cu") add_files("../src/infiniop/devices/nvidia/*.cu", "../src/infiniop/ops/*/nvidia/*.cu")
target_end() target_end()
target("infinirt-iluvatar") target("infinirt-iluvatar")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment