|
|
|
@@ -1,5 +1,5 @@ |
|
|
|
/** |
|
|
|
* Copyright 2020 Huawei Technologies Co., Ltd |
|
|
|
* Copyright 2020-2021 Huawei Technologies Co., Ltd |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@@ -14,8 +14,8 @@ |
|
|
|
* limitations under the License. |
|
|
|
*/ |
|
|
|
|
|
|
|
#ifndef MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_GPU_ASSIGN_GPU_KERNEL_H |
|
|
|
#define MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_GPU_ASSIGN_GPU_KERNEL_H |
|
|
|
#ifndef MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_GPU_OTHER_ASSIGN_GPU_KERNEL_H_ |
|
|
|
#define MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_GPU_OTHER_ASSIGN_GPU_KERNEL_H_ |
|
|
|
|
|
|
|
#include <vector> |
|
|
|
#include "backend/kernel_compiler/gpu/gpu_kernel.h" |
|
|
|
@@ -40,11 +40,11 @@ class AssignGpuKernel : public GpuKernel { |
|
|
|
CHECK_CUDA_RET_WITH_EXCEPT( |
|
|
|
kernel_node_, |
|
|
|
cudaMemcpyAsync(var, value, input_size_, cudaMemcpyDeviceToDevice, reinterpret_cast<cudaStream_t>(stream_ptr)), |
|
|
|
"cudaMemxcpyAsync failed."); |
|
|
|
"cudaMemcpyAsync failed."); |
|
|
|
CHECK_CUDA_RET_WITH_EXCEPT( |
|
|
|
kernel_node_, |
|
|
|
cudaMemcpyAsync(output, value, input_size_, cudaMemcpyDeviceToDevice, reinterpret_cast<cudaStream_t>(stream_ptr)), |
|
|
|
"cudaMemxcpyAsync failed."); |
|
|
|
"cudaMemcpyAsync failed."); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -93,4 +93,4 @@ class AssignGpuKernel : public GpuKernel { |
|
|
|
} // namespace kernel |
|
|
|
} // namespace mindspore |
|
|
|
|
|
|
|
#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_GPU_ASSIGN_GPU_KERNEL_H |
|
|
|
#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_GPU_OTHER_ASSIGN_GPU_KERNEL_H_ |