ullmax

产品支持情况

  • Ascend 950PR&950DT系列产品:支持
  • Atlas A3系列产品:不支持
  • Atlas A2系列产品:不支持
  • Atlas 200I/500 A2推理产品:不支持
  • Atlas推理系列产品AI Core:不支持
  • Atlas推理系列产品Vector Core:不支持
  • Atlas训练系列产品:不支持

功能说明

头文件路径为:"simt_api/math_functions.h"。

获取两个输入数据中的最大值。

函数原型

inline unsigned long long int ullmax(const unsigned long long int x, const unsigned long long int y)

参数说明

表1 参数说明

参数名 输入/输出 描述
x 输入 源操作数。
y 输入 源操作数。

返回值说明

两个输入数据中的最大值。

约束说明

无

调用示例

  • SIMT编程场景:

    #include "simt_api/math_functions.h"
    
    __global__ __launch_bounds__(1024) void KernelUllmax(unsigned long long int* dst, unsigned long long int* x, unsigned long long int* y)
    {
        int idx = threadIdx.x + blockIdx.x * blockDim.x;
        dst[idx] = ullmax(x[idx], y[idx]);
    }
    
  • SIMD与SIMT混合编程场景:

    #include "simt_api/math_functions.h"
    
    __simt_vf__ __launch_bounds__(1024) inline void KernelUllmax(__gm__ unsigned long long int* dst, __gm__ unsigned long long int* x, __gm__ unsigned long long int* y)
    {
        int idx = threadIdx.x + blockIdx.x * blockDim.x;
        dst[idx] = ullmax(x[idx], y[idx]);
    }