-
Notifications
You must be signed in to change notification settings - Fork 68
[Bug] cuda code compilation error #89
Copy link
Copy link
Closed
Description
I have the following cuda code generated by hidet:
#include <cuda_fp16.h>
#include <cuda_bf16.h>
#include <hidet/runtime/cuda_context.h>
#include <hidet/runtime/cpu_context.h>
typedef float tfloat32_t;
#define __float_to_tf32(x) (x)
/*
Task(
name: clip
parameters:
x: tensor(int64, [1, 4, 1, 1])
y: tensor(int64, [1, 4, 1, 1])
inputs: [x]
outputs: [y]
computations:
x: tensor(int64, [1, 4, 1, 1])
y: int64[1, 4, 1, 1] where y[v, v_1, v_2, v_3] = generic_min(generic_max(x[v, v_1, v_2, v_3], int64(-1)), int64(1))
attributes: {}
)
*/
extern "C" {
__global__ void __launch_bounds__(500) hidet_compute_y(int64_t * __restrict__ x, int64_t * __restrict__ y) {
if ((int)threadIdx.x < 4) {
y[((int)threadIdx.x % 4)] = min(max(x[((int)threadIdx.x % 4)], -1ll), 1ll);
}
}
__host__ void hidet_clip(int32_t num_args, int32_t * __restrict__ arg_types, void* * __restrict__ args) {
hidet_compute_y<<<1, 500, 0, (cudaStream_t)get_cuda_stream()>>>(((int64_t*)(args[0])), ((int64_t*)(args[1])));
}
}
And nvcc raises an error:
error: more than one instance of overloaded function "max" matches the argument list:
function "max(long, long)"
/usr/local/cuda/bin/../targets/x86_64-linux/include/crt/math_functions.hpp(1008): here
function "max(long, unsigned long)"
/usr/local/cuda/bin/../targets/x86_64-linux/include/crt/math_functions.hpp(1043): here
function "max(long long, long long)"
/usr/local/cuda/bin/../targets/x86_64-linux/include/crt/math_functions.hpp(1077): here
function "max(unsigned long long, long long)"
/usr/local/cuda/bin/../targets/x86_64-linux/include/crt/math_functions.hpp(1092): here
argument types are: (int64_t, long long)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels