Hugging Face
Models
Datasets
Spaces
Buckets
new
Docs
Enterprise
Pricing
Website
Tasks
HuggingChat
Collections
Languages
Organizations
Community
Blog
Posts
Daily Papers
Learn
Discord
Forum
GitHub
Solutions
Team & Enterprise
Hugging Face PRO
Enterprise Support
Inference Providers
Inference Endpoints
Storage Buckets
Log In
Sign Up
FasterDFlash
/
Hanrui
like
0
Follow
FasterDFlash
2
Model card
Files
Files and versions
xet
Community
Copy to bucket
new
main
Hanrui
/
sglang
/
sgl-kernel
/
include
/
pytorch_extension_utils_rocm.h
Lekr0
Add files using upload-large-folder tool
a402b9b
verified
about 2 months ago
raw
Copy download link
history
blame
contribute
delete
803 Bytes
#
include
<torch/library.h>
#
define
CHECK_CUDA(x) TORCH_CHECK(x.is_cuda(), #x
" must be a CUDA tensor"
)
#
define
CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x
" must be contiguous"
)
#
define
CHECK_LAST_DIM_CONTIGUOUS(x) \
TORCH_CHECK(x.strides()[x.strides().size() - 1] == 1, #x
"must be contiguous at last dimension"
)
#
define
CHECK_INPUT(x) \
CHECK_CUDA(x); \
CHECK_CONTIGUOUS(x)
#
define
CHECK_LAST_DIM_CONTIGUOUS_INPUT(x) \
CHECK_CUDA(x); \
CHECK_LAST_DIM_CONTIGUOUS(x)
#
define
CHECK_DIM(d, x) TORCH_CHECK(x.dim() == d, #x
" must be a "
#d
"D tensor"
)
#
define
CHECK_EQ(a, b) TORCH_CHECK((a) == (b),
"CHECK_EQ("
#a
", "
#b
") failed. "
, a,
" vs "
, b)
#
define
CHECK_GE(a, b) TORCH_CHECK((a) >= (b),
"CHECK_GE("
#a
", "
#b
") failed. "
, a,
" vs "
, b)