diff --git a/mindspore/lite/src/runtime/gpu/gpu_runtime.h b/mindspore/lite/src/runtime/gpu/gpu_runtime.h index 45eba8d829b..039ced6f872 100644 --- a/mindspore/lite/src/runtime/gpu/gpu_runtime.h +++ b/mindspore/lite/src/runtime/gpu/gpu_runtime.h @@ -101,6 +101,5 @@ class GpuRuntimeWrapper { private: T *gpu_runtime_{nullptr}; }; - } // namespace mindspore::lite::gpu #endif // MINDSPORE_LITE_SRC_GPU_RUNTIME_H_ diff --git a/mindspore/lite/src/runtime/gpu/opencl/opencl_allocator.h b/mindspore/lite/src/runtime/gpu/opencl/opencl_allocator.h index 5a60f915b71..2f061932c3f 100644 --- a/mindspore/lite/src/runtime/gpu/opencl/opencl_allocator.h +++ b/mindspore/lite/src/runtime/gpu/opencl/opencl_allocator.h @@ -116,7 +116,6 @@ class OpenCLAllocator : public mindspore::Allocator { int shift_factor_ = 6; bool lock_flag_ = true; }; - } // namespace mindspore::lite::opencl #endif // MINDSPORE_LITE_SRC_RUNTIME_OPENCL_ALLOCATOR_H_ diff --git a/mindspore/lite/src/runtime/gpu/opencl/opencl_runtime.cc b/mindspore/lite/src/runtime/gpu/opencl/opencl_runtime.cc index 3b014fc8711..f3bc7d7a95c 100644 --- a/mindspore/lite/src/runtime/gpu/opencl/opencl_runtime.cc +++ b/mindspore/lite/src/runtime/gpu/opencl/opencl_runtime.cc @@ -462,22 +462,16 @@ int OpenCLRuntime::RunKernel(const cl::Kernel &kernel, const cl::NDRange &global // get gpu divce type GpuInfo OpenCLRuntime::ParseGpuInfo(std::string device_name, std::string device_version) { GpuInfo info; - if (device_name == "QUALCOMM Adreno(TM)") { info.type = ADRENO; - sscanf(device_version.c_str(), "%*s%f%*s%d", &info.opencl_version, &info.model_num); } else if (device_name.find("Mali") != std::string::npos) { info.type = MALI; - // Mali type MALI-G or MALI_T if (device_name.find("Mali-G") != std::string::npos) { info.type = MALI_G; - sscanf(device_name.c_str(), "Mali-G%d", &info.model_num); } else if (device_name.find("Mali-T") != std::string::npos) { info.type = MALI_T; - sscanf(device_name.c_str(), "Mali-T%d", &info.model_num); } - sscanf(device_version.c_str(), "%*s%f%*s", &info.opencl_version); } return info; } diff --git a/mindspore/lite/src/runtime/gpu/opencl/opencl_runtime.h b/mindspore/lite/src/runtime/gpu/opencl/opencl_runtime.h index 88676cda0b0..40a520b4837 100644 --- a/mindspore/lite/src/runtime/gpu/opencl/opencl_runtime.h +++ b/mindspore/lite/src/runtime/gpu/opencl/opencl_runtime.h @@ -37,8 +37,6 @@ enum InitState { UnInit = 0, InitSuccess = 1, InitFailed = 2 }; struct GpuInfo { GpuType type = OTHER; - int model_num = 0; - float opencl_version = 0; }; class OpenCLRuntimeWrapper; class OpenCLRuntime { diff --git a/mindspore/lite/src/runtime/gpu/opencl/opencl_wrapper.h b/mindspore/lite/src/runtime/gpu/opencl/opencl_wrapper.h index b879b437f18..3144d8fd237 100644 --- a/mindspore/lite/src/runtime/gpu/opencl/opencl_wrapper.h +++ b/mindspore/lite/src/runtime/gpu/opencl/opencl_wrapper.h @@ -204,7 +204,6 @@ CL_DECLARE_FUNC_PTR(clSetKernelArgSVMPointer); #endif #undef CL_DECLARE_FUNC_PTR - } // namespace mindspore::lite::opencl #endif // USE_OPENCL_WRAPPER #endif // MINDSPORE_LITE_SRC_OPENCL_WRAPPER_H_ diff --git a/mindspore/lite/src/runtime/kernel/opencl/kernel/cast.h b/mindspore/lite/src/runtime/kernel/opencl/kernel/cast.h index c8c4e38384f..3db1f15a008 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/kernel/cast.h +++ b/mindspore/lite/src/runtime/kernel/opencl/kernel/cast.h @@ -39,6 +39,5 @@ class CastOpenCLKernel : public OpenCLKernel { private: GpuTensorInfo shape_; }; - } // namespace mindspore::kernel #endif diff --git a/mindspore/lite/src/runtime/kernel/opencl/kernel/strided_slice.h b/mindspore/lite/src/runtime/kernel/opencl/kernel/strided_slice.h index c1d9a339985..87e2638dc49 100644 --- a/mindspore/lite/src/runtime/kernel/opencl/kernel/strided_slice.h +++ b/mindspore/lite/src/runtime/kernel/opencl/kernel/strided_slice.h @@ -46,6 +46,5 @@ class StridedSliceOpenCLKernel : public OpenCLKernel { cl_int4 stride_{{1, 1, 1, 1}}; cl_int4 size_{}; }; - } // namespace mindspore::kernel #endif diff --git a/mindspore/lite/test/config/ut_gpu.cfg b/mindspore/lite/test/config/ut_gpu.cfg index 6c7bb24a750..044e11733d5 100644 --- a/mindspore/lite/test/config/ut_gpu.cfg +++ b/mindspore/lite/test/config/ut_gpu.cfg @@ -1,5 +1,8 @@ -TestOpenCL_Transpose.* -TestOpenCL_DepthwiseConv2d.* +TestOpenCL_Transpose.NHWC2NCHW +TestOpenCL_Transpose.NCHW2NHWC +TestOpenCL_Transpose.NHWC2NWHC +TestOpenCL_Transpose.NWC2CWN +TestOpenCL_Transpose.NWC2WNC TestOpenCL_StridedSlice.1D TestOpenCL_StridedSlice.2D TestOpenCL_StridedSlice.3D @@ -8,35 +11,54 @@ TestOpenCL_StridedSlice.4D_stride2 TestOpenCL_StridedSlice.4D_to_3D TestOpenCL_StridedSlice.test1 TestOpenCL_Split.input3_axis0 -TestOpenCL_DepthToSpace.* -TestOpenCL_SpaceToDepth.* -TestOpenCL_SpaceToBatch.* -TestOpenCL_SoftMax.* +TestOpenCL_DepthToSpace.AlignTest1 +TestOpenCL_DepthToSpace.AlignTest2 +TestOpenCL_DepthToSpace.AlignTest3 +TestOpenCL_DepthToSpace.AlignTest4 +TestOpenCL_DepthToSpace.NotAlignTest1 +TestOpenCL_DepthToSpace.NotAlignTest2 +TestOpenCL_DepthToSpace.NotAlignTest3 +TestOpenCL_DepthToSpace.NotAlignTest4 +TestOpenCL_SpaceToDepth.AlignTest1 +TestOpenCL_SpaceToDepth.AlignTest2 +TestOpenCL_SpaceToDepth.AlignTest3 +TestOpenCL_SpaceToDepth.NotAlignTest1 +TestOpenCL_SpaceToDepth.NotAlignTest2 +TestOpenCL_SpaceToDepth.NotAlignTest3 +TestOpenCL_SpaceToDepth.NotAlignTest4 +TestOpenCL_SpaceToBatch.H2W2Pad2222 +TestOpenCL_SpaceToBatch.H2W2Pad2222MultiBatch +TestOpenCL_SoftMax.2D_axis1 +TestOpenCL_SoftMax.4D_axis3 +TestOpenCL_SoftMax.4D_axis1 +TestOpenCL_SoftMax.2D_axis1_N +TestOpenCL_SoftMax.4D_axis3_N +TestOpenCL_SoftMax.4D_axis1_N TestOpenCL_Slice.4D -TestOpenCL_Shape.* -TestOpenCL_Scale.* -TestOpenCL_Resize.* -TestOpenCL_Reshape.* -TestOpenCL_Reduce.* -TestOpenCL_Pooling.* -TestOpenCL_Pad.1D -TestOpenCL_Pad.2D -TestOpenCL_Pad.3D -TestOpenCL_Pad.4D -TestOpenCL_OneHot.* -TestOpenCL_MatMul.2D -TestOpenCL_MatMul.3D -TestOpenCL_MatMul.4D -TestOpenCL_LayerNorm.* -TestOpenCL_Gather.* -TestOpenCL_FullConnection.* -TestOpenCL_Conv2D.test0 -TestOpenCL_Conv2D.test0_no_bias -TestOpenCL_Conv2D.test1 -TestOpenCL_Conv2D.test2 -TestOpenCL_Conv2D.test3 -TestOpenCL_Conv2D.test3_batch2 -TestOpenCL_BatchToSpaceND.* +TestOpenCL_Shape.test0 +TestOpenCL_Scale.Axis1 +TestOpenCL_Scale.Axis3 +TestOpenCL_Scale.Axis3RELU6 +TestOpenCL_Resize.Bilinear +TestOpenCL_Resize.Bilinear_AlignCorners +TestOpenCL_Resize.NEAREST +TestOpenCL_Resize.BilinearBatch +TestOpenCL_Resize.Bilinear_AlignCornersBatch +TestOpenCL_Resize.NEARESTBatch +TestOpenCL_Reshape.4D_2D_test0 +TestOpenCL_Reshape.4D_4D_test0 +TestOpenCL_Reshape.4D_2D_test1 +TestOpenCL_Reshape.4D_4D_test1 +TestOpenCL_Reshape.4D_4D_test2 +TestOpenCL_Reshape.4D_4D_test3 +TestOpenCL_Reshape.4D_4D_test4 +TestOpenCL_Reshape.4D_4D_test5 +TestOpenCL_Reshape.3D_2D_test6 +TestOpenCL_Activation.RELU +TestOpenCL_Activation.RELU6 +TestOpenCL_Activation.HSIGMOID +TestOpenCL_Activation.HSWISH +TestOpenCL_ArithmeticSelf.Round TestOpenCL_Arithmetic.ElementwiseAdd TestOpenCL_Arithmetic.ScalarMul TestOpenCL_Arithmetic.BroadcastSubReLU6 @@ -45,14 +67,68 @@ TestOpenCL_Arithmetic.BroadcastSub3 TestOpenCL_Arithmetic.BroadcastFloorMod TestOpenCL_Arithmetic.FloorMod TestOpenCL_Arithmetic.ElementwiseDiv -TestOpenCL_ArithmeticSelf.* -TestOpenCL_Activation.* -TestOpenCL_Concat.input2_axis0 -TestOpenCL_Concat.input2_axis0_shape1 -TestOpenCL_Concat.input2_axis1_Align -TestOpenCL_Concat.input6_axis1_Align -TestOpenCL_Concat.input6_axis2_Align -TestOpenCL_Concat.input3_axis1_UnAlign -TestOpenCL_Concat.input4_axis3_UnAlign -TestOpenCL_Concat.input5_axis3_UnAlign -TestOpenCL_Concat.input6_axis3_UnAlign +TestOpenCL_BatchToSpaceND.H2W2Pad2020 +TestOpenCL_BatchToSpaceND.H3W3Pad0101 +TestOpenCL_Conv2D.test0 +TestOpenCL_Conv2D.test0_no_bias +TestOpenCL_Conv2D.test1 +TestOpenCL_Conv2D.test2 +TestOpenCL_Conv2D.test3 +TestOpenCL_Conv2D.test3_batch2 +TestOpenCL_Conv2dTranspose.test0 +TestOpenCL_Conv2dTranspose.test1 +TestOpenCL_Conv2dTranspose.test2 +TestOpenCL_Conv2dTranspose.test0MultiBatch +TestOpenCL_Conv2dTranspose.test1MultiBatch +TestOpenCL_Conv2dTranspose.test2MultiBatch +TestOpenCL_DepthwiseConv2d.NoPad +TestOpenCL_DepthwiseConv2d.Pad +TestOpenCL_DepthwiseConv2d.NoPad1 +TestOpenCL_DepthwiseConv2d.Pad1 +TestOpenCL_FullConnection.2D +TestOpenCL_FullConnection.4D +TestOpenCL_FullConnection.3D +TestOpenCL_FullConnection.3DWeightVar +TestOpenCL_LayerNorm.test1 +TestOpenCL_MatMul.2D +TestOpenCL_MatMul.4D +TestOpenCL_MatMul.3D +TestOpenCL_OneHot.OneHot4DAxis3Fp32 +TestOpenCL_OneHot.OneHot4DAxis3T2Fp32 +TestOpenCL_OneHot.OneHot4DAxis3T3Fp32 +TestOpenCL_OneHot.OneHot4DAxis3T4Fp32 +TestOpenCL_OneHot.OneHot4DAxis2Fp32 +TestOpenCL_OneHot.OneHot4DAxis2T2Fp32 +TestOpenCL_OneHot.OneHot4DAxis2T3Fp32 +TestOpenCL_OneHot.OneHot4DAxis2T4Fp32 +TestOpenCL_OneHot.OneHot4DAxis1T1Fp32 +TestOpenCL_OneHot.OneHot4DAxis1T2Fp32 +TestOpenCL_OneHot.OneHot4DAxis1T3Fp32 +TestOpenCL_OneHot.OneHot4DAxis0Fp32 +TestOpenCL_OneHot.OneHot4DAxis0T2Fp32 +TestOpenCL_OneHot.OneHot4DAxis0T3Fp32 +TestOpenCL_OneHot.OneHot3DAxis0Fp32 +TestOpenCL_OneHot.OneHot3DAxis0T2Fp32 +TestOpenCL_OneHot.OneHot3DAxis1Fp32 +TestOpenCL_OneHot.OneHot3DAxis1T2Fp32 +TestOpenCL_OneHot.OneHot3DAxis2Fp32 +TestOpenCL_OneHot.OneHot3DAxis2T2Fp32 +TestOpenCL_OneHot.OneHot2DAxis0Fp32 +TestOpenCL_OneHot.OneHot2DAxis0T2Fp32 +TestOpenCL_OneHot.OneHot2DAxis1Fp32 +TestOpenCL_OneHot.OneHot2DAxis1T2Fp32 +TestOpenCL_OneHot.OneHot1DAxis0Fp32 +TestOpenCL_OneHot.OneHot1DAxis0T2Fp32 +TestOpenCL_Pad.1D +TestOpenCL_Pad.2D +TestOpenCL_Pad.4D +TestOpenCL_Pad.test0 +TestOpenCL_Pooling.Avg +TestOpenCL_Pooling.Max +TestOpenCL_Pooling.AvgMultiBatch +TestOpenCL_Pooling.MaxMultiBatch +TestOpenCL_Reduce.Mean +TestOpenCL_Reduce.Sum +TestOpenCL_Reduce.MeanWC +TestOpenCL_Reduce.SumWC +TestOpenCL_Reduce.MeanC