tinygrad/extra/thunder/cuda/include/pyutils/torch_helpers.cuh
2025-10-10 00:32:33 -07:00

7 lines
No EOL
271 B
Text

#pragma once
#include <torch/extension.h>
#define CHECK_CUDA(x) TORCH_CHECK(x.device().is_cuda(), #x " must be a CUDA tensor")
#define CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x " must be contiguous")
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)