forked from EngineX-Cambricon/enginex-mlu370-vllm
add ops
This commit is contained in:
29
torch_mlu_ops-v1.3.2/csrc/kernels/add_scalar.mluh
Normal file
29
torch_mlu_ops-v1.3.2/csrc/kernels/add_scalar.mluh
Normal file
@@ -0,0 +1,29 @@
|
||||
/*************************************************************************
|
||||
* Copyright (C) [2023-2024] by Cambricon, Inc.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*************************************************************************/
|
||||
#ifndef CSRC_KERNELS_ADD_SCALAR_MLUH_
|
||||
#define CSRC_KERNELS_ADD_SCALAR_MLUH_
|
||||
#include "kernel_utils.h"
|
||||
|
||||
namespace tmo {
|
||||
/**
|
||||
* @brief Add src with a scalar and save the result to dst.
|
||||
* @param queue: The queue for mlu.
|
||||
* @param dst: Pointer to the MLU memory of dst.
|
||||
* @param src: Pointer to the MLU memory of src.
|
||||
* @param count: The elements number in src.
|
||||
* @param scalar: The scalar to add.
|
||||
* @note: only support int. dst can overlap with src.
|
||||
*/
|
||||
KernelStatus invokeMLUAddScalar(cnrtQueue_t queue, int *dst, int *src, int count, int scalar);
|
||||
} // namespace tmo
|
||||
|
||||
#endif // CSRC_KERNELS_ADD_SCALAR_MLUH_
|
||||
Reference in New Issue
Block a user