Skip to content
KernelIndex
Search⌘K

submission 516094

Weyland Joyner · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

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

submission.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-grayscale-v2-516094?include=source"
interfacepython
Compatibility
measured onNVIDIA A100
declared hardwareNVIDIA A100
architecturessm_80
dtypesfp32

Benchmark evidence

1 measurement across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
RGB to grayscalesuite of 6 cases
NVIDIA A100
2.61ms
#32 of 137
2026-03-07

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:ade6e26a550e3b9d241ae980e4ceaec09dc242b5133bfdea337f37b1e92b8a43
license declaredunknown
license concludedunknown
authorsWeyland Joyner
imported2026-08-15

Kernel source

submission.py44 lines
#!POPCORN leaderboard grayscale_v2
#!POPCORN gpu A100

import torch
import triton
import triton.language as tl

@triton.jit
def grayscale_kernel(
    input_ptr,
    output_ptr,
    H,
    W,
    BLOCK: tl.constexpr
):
    pid = tl.program_id(0)
    pixel_idx = pid * BLOCK + tl.arange(0, BLOCK)
    mask = pixel_idx < H * W

    base = pixel_idx * 3
    R = tl.load(input_ptr + base + 0, mask=mask, other=0.0)
    G = tl.load(input_ptr + base + 1, mask=mask, other=0.0)
    B = tl.load(input_ptr + base + 2, mask=mask, other=0.0)

    gray = 0.2989 * R + 0.5870 * G + 0.1140 * B
    tl.store(output_ptr + pixel_idx, gray, mask=mask)

def custom_kernel(data):
    input_tensor, output_tensor = data
    H, W, _ = input_tensor.shape
    N = H * W

    BLOCK = 1024
    grid = (triton.cdiv(N, BLOCK),)

    grayscale_kernel[grid](
        input_tensor,
        output_tensor,
        H,
        W,
        BLOCK=BLOCK
    )
    return output_tensor
scrolls · 44 lines total

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

Best evidence level for this revision: reported

JSON