Dataset Viewer
Auto-converted to Parquet Duplicate
messages
listlengths
2
230
[ { "role": "user", "content": "Implement a fused matrix addition and scaling kernel.\n\nYour implementation should:\n1. Compute C = (A + B) * scale for square matrices\n2. Use a 2D grid/block layout similar to the seed matrix multiplication kernel\n3. Support any square matrix dimensions\n4. Properly handle ...
[ { "role": "user", "content": "Implement a fused set-union-and-scale kernel that:\n1. Computes the union of two sorted integer arrays A and B\n2. Scales each unique element by a given factor\n\nThe algorithm should:\n- Merge elements from arrays A and B in sorted order\n- Keep duplicates (like thrust::set_un...
[ { "role": "user", "content": "Implement a CUDA kernel that applies an exponential growth transformation and value clamping to each element.\n\nThe kernel should:\n1. For each element, compute a growth value using: growth = weight * (2.0 * exp(-(input[i] - mu)^2 / sigma^2) - 1.0)\n2. Add the growth to the co...
[ { "role": "user", "content": "Implement a row-wise minimum finder kernel that finds both the minimum value\nand its column index for each row in a 2D float array.\n\nYour implementation should:\n1. Use CUB's BlockReduce with ArgMin reducer to find column-wise minima\n2. Launch with one block per row (2D gri...
[ { "role": "user", "content": "Implement a broadcast addition operation that adds two tensors with different shapes.\n\nGiven two tensors:\n- x: shape [x_dim0, 1] (column vector)\n- y: shape [y_dim0, dim1] (2D matrix)\n- output: shape [x_dim0, dim1]\n\nThe operation broadcasts x along dimension 1 and broadca...
[ { "role": "user", "content": "Implement a CUDA kernel that counts the number of pairwise absolute differences\nbetween two arrays that exceed a given threshold.\n\nFor arrays A and B of size n, compute the count of indices i where |A[i] - B[i]| > threshold.\n\nYour implementation should:\n1. Use grid stride...
[ { "role": "user", "content": "Compute a matrix of pairwise squared Euclidean distances between two sets of 2D points.\n\nGiven M points in set A and N points in set B, compute an MxN distance matrix\nwhere each element (i,j) contains the squared Euclidean distance:\n\n distances[i * N + j] = (A[i].x - B[j]...
[ { "role": "user", "content": "Implement a vector addition with scaling kernel. The kernel should add two input vectors element-wise and multiply the result by a scalar factor.\n\nYour function signature is in include/solution_header.h.\n\nRequirements:\n1. Use a 1D grid with configurable block size (e.g., 2...
[ { "role": "user", "content": "Implement a partitioned prefix sum with chunk index mapping.\n\nYour implementation should:\n1. Compute prefix sum (cumulative sum) on the input array: prefix_sum[i] = sum(input[0..i])\n2. For each element, compute which chunk it belongs to: chunk_ids[i] = i / chunk_size\n3. Us...
[ { "role": "user", "content": "Implement scaled dot-product attention, a core operation in transformer models.\n\nYour implementation should:\n1. Compute attention scores: scores[query_row][key_col] = scale * dot(Q[query_row], K[key_col])\n2. Compute softmax: attn[query_row][key_col] = exp(scores[query_row][...
[ { "role": "user", "content": "Implement a CUDA kernel that computes the row-wise minimum of a matrix.\n\nGiven an M x N matrix, compute an output array of size M where each element\noutput[i] is the minimum value in row i of the input matrix.\n\nYour function signature is in include/solution_header.h.\n\n##...
[ { "role": "user", "content": "Implement a cumulative maximum computation with position tracking.\n\nGiven a sequence of floating-point numbers, compute the cumulative maximum\nfrom the beginning up to each position, along with the index where each\ncumulative maximum was first attained.\n\nFor input [x0, x1...
[ { "role": "user", "content": "Implement a conditional vector addition kernel with threshold counting.\n\nYour kernel should:\n1. Add two double-precision vectors element-wise: C[i] = A[i] + B[i]\n2. Use atomicAdd to count how many results exceed a given threshold\n3. Store the count in a counter variable\n\...
[ { "role": "user", "content": "Implement a kernel that raises each element of a matrix to a power equal to its row index.\n\nFor a matrix with M rows and N columns:\n- Row 0 remains unchanged\n- Row 1: elements raised to power 2 (x^2)\n- Row 2: elements raised to power 3 (x^3)\n- ... \n- Row i: elements rais...
[ { "role": "user", "content": "Implement an indexed complex number negation kernel.\n\nFor each index i in the indices array, negate a complex number from the input\narray and write it to the gains array at position indices[i]. Both gains and\ninput store complex numbers as interleaved [real, imag] pairs.\n\...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
161