This task is purely for testing the submission system. There will be *no* points.
> Input: (input_tensor, output_tensor)
> - input_tensor: Input data
> - output_tensor: Pre-allocated empty tensor of the same shape as `input_tensor`
> Output: Should return `output_tensor` after it has been filled with the values from `input_tensor`.`
Reference Implementation
import torch
from task import input_t, output_t
from utils import make_match_reference
def generate_input(size: int, seed: int) -> input_t:
gen = torch.Generator(device='cuda')
gen.manual_seed(seed)
data = torch.empty(size, device='cuda', dtype=torch.float16)
data.uniform_(0, 1, generator=gen)
return data, torch.empty_like(data)
def ref_kernel(data: input_t) -> output_t:
input, output = data
output[...] = input
return output
check_implementation = make_match_reference(ref_kernel)