tensor: add scale elementwise CUDA kernel + FFI

New csrc/ops/elementwise.cu (out[i]=in[i]*alpha), compiled by
xtrain-cuda/build.rs and exposed via launch_scale_f32 FFI, gated behind
not(no_cuda) like the existing vecadd smoke test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 15:13:06 +08:00
parent 8557a289a2
commit 63dc05fd10
3 changed files with 30 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ fn main() {
.cudart("shared")
.flag("-gencode=arch=compute_120,code=sm_120")
.file("../../csrc/test/vecadd.cu")
.file("../../csrc/ops/elementwise.cu")
.compile("xtrain_cuda_kernels");
}