Skip to content
KernelIndex
Search⌘K

submission 37986

Sahith · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

No package. Vendor the mirrored source: 26 lines, June 9 Researcher Reciprocity License v1.0.

submission_pytorch.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-vectoradd-v2-37986?include=source"
interfacepython
Compatibility
measured onNVIDIA L4
declared hardwareNVIDIA L4
architecturessm_89
dtypesfp16

Benchmark evidence

1 measurement across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
FP16 vector additionsuite of 5 cases
NVIDIA L4
6.99ms
#22 of 26
2025-09-13

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:35b957e362052eae3ba2a5c61294448d8f91830e97ea01b013d61e4a6d2fa1f9
license declaredunknown
license concludedunknown
authorsSahith
imported2026-08-15

Kernel source

submission_pytorch.py26 lines
import torch
from torch.utils.cpp_extension import load_inline
from typing import List
from task import input_t, output_t


def custom_kernel(data: input_t) -> output_t:
    """
    Custom implementation of vector addition using CUDA.
    Args:
        inputs: List of pairs of tensors [A, B] to be added.
    Returns:
        Tensor containing element-wise sum.
    """
    A, B, C = data

    assert A.is_cuda and B.is_cuda, "Input tensors must be on GPU"
    assert A.shape == B.shape, "Input tensors must have the same shape"
    assert A.dtype == torch.float16 and B.dtype == torch.float16, "Input tensors must be float16"
    
    # Simply reuse the existing add function we already defined
    # This avoids the compilation issues with the inline kernel
    C = A + B
    return C
    #return add(A, B)

Source code from GPU Mode and the KernelBot dataset · June 9 Researcher Reciprocity License v1.0

Changes from previous submission

Against this author's previous submission submission 37985.

Best evidence level for this revision: reported

JSON