diff --git a/challenges/easy/43_count_array_element/starter/starter.cu b/challenges/easy/43_count_array_element/starter/starter.cu deleted file mode 100644 index 0023952a..00000000 --- a/challenges/easy/43_count_array_element/starter/starter.cu +++ /dev/null @@ -1,12 +0,0 @@ -#include - -__global__ void count_equal_kernel(const int* input, int* output, int N, int K) {} - -// input, output are device pointers (i.e. pointers to memory on the GPU) -extern "C" void solve(const int* input, int* output, int N, int K) { - int threadsPerBlock = 256; - int blocksPerGrid = (N + threadsPerBlock - 1) / threadsPerBlock; - - count_equal_kernel<<>>(input, output, N, K); - cudaDeviceSynchronize(); -} diff --git a/challenges/easy/43_count_array_element/starter/starter.mojo b/challenges/easy/43_count_array_element/starter/starter.mojo deleted file mode 100644 index 27e93fe5..00000000 --- a/challenges/easy/43_count_array_element/starter/starter.mojo +++ /dev/null @@ -1,22 +0,0 @@ -from gpu.host import DeviceContext -from gpu.id import block_dim, block_idx, thread_idx -from memory import UnsafePointer -from math import ceildiv - -fn count_equal_kernel(input: UnsafePointer[Int32], output: UnsafePointer[Int32], N: Int32, K: Int32): - pass - -# input, output are device pointers (i.e. pointers to memory on the GPU) -@export -def solve(input: UnsafePointer[Int32], output: UnsafePointer[Int32], N: Int32, K: Int32): - var BLOCK_SIZE: Int32 = 256 - var ctx = DeviceContext() - var num_blocks = ceildiv(N, BLOCK_SIZE) - - ctx.enqueue_function[count_equal_kernel]( - input, output, N, K, - grid_dim = num_blocks, - block_dim = BLOCK_SIZE - ) - - ctx.synchronize() diff --git a/challenges/easy/43_count_array_element/starter/starter.triton.py b/challenges/easy/43_count_array_element/starter/starter.triton.py deleted file mode 100644 index 6f4ba1a7..00000000 --- a/challenges/easy/43_count_array_element/starter/starter.triton.py +++ /dev/null @@ -1,18 +0,0 @@ -import torch -import triton -import triton.language as tl - - -@triton.jit -def count_equal_kernel(input_ptr, output_ptr, N, K, BLOCK_SIZE: tl.constexpr): - pass - - -# input, output are tensors on the GPU -def solve(input: torch.Tensor, output: torch.Tensor, N: int, K: int): - BLOCK_SIZE = 256 - - def grid(meta): - return (triton.cdiv(N, meta["BLOCK_SIZE"]),) - - count_equal_kernel[grid](input, output, N, K, BLOCK_SIZE=BLOCK_SIZE) diff --git a/challenges/easy/44_count_2d_array_element/starter/starter.cu b/challenges/easy/44_count_2d_array_element/starter/starter.cu deleted file mode 100644 index e77c729d..00000000 --- a/challenges/easy/44_count_2d_array_element/starter/starter.cu +++ /dev/null @@ -1,13 +0,0 @@ -#include - -__global__ void count_2d_equal_kernel(const int* input, int* output, int N, int M, int K) {} - -// input, output are device pointers (i.e. pointers to memory on the GPU) -extern "C" void solve(const int* input, int* output, int N, int M, int K) { - dim3 threadsPerBlock(16, 16); - dim3 blocksPerGrid((M + threadsPerBlock.x - 1) / threadsPerBlock.x, - (N + threadsPerBlock.y - 1) / threadsPerBlock.y); - - count_2d_equal_kernel<<>>(input, output, N, M, K); - cudaDeviceSynchronize(); -} diff --git a/challenges/easy/44_count_2d_array_element/starter/starter.mojo b/challenges/easy/44_count_2d_array_element/starter/starter.mojo deleted file mode 100644 index e2eb976f..00000000 --- a/challenges/easy/44_count_2d_array_element/starter/starter.mojo +++ /dev/null @@ -1,22 +0,0 @@ -from gpu.host import DeviceContext -from gpu.id import block_dim, block_idx, thread_idx -from memory import UnsafePointer -from math import ceildiv - -fn count_2d_equal_kernel(input: UnsafePointer[Int32], output: UnsafePointer[Int32], N: Int32, M: Int32, K: Int32): - pass - -# input, output are device pointers (i.e. pointers to memory on the GPU) -@export -def solve(input: UnsafePointer[Int32], output: UnsafePointer[Int32], N: Int32, M: Int32, K: Int32): - var BLOCK_SIZE: Int32 = 16 - var ctx = DeviceContext() - var grid_dim_x = ceildiv(M, BLOCK_SIZE) - var grid_dim_y = ceildiv(N, BLOCK_SIZE) - - ctx.enqueue_function[count_2d_equal_kernel]( - input, output, N, M, K, - grid_dim = (grid_dim_x, grid_dim_y), - block_dim = (BLOCK_SIZE, BLOCK_SIZE) - ) - ctx.synchronize() diff --git a/challenges/medium/15_sorting/challenge.html b/challenges/hard/15_sorting/challenge.html similarity index 100% rename from challenges/medium/15_sorting/challenge.html rename to challenges/hard/15_sorting/challenge.html diff --git a/challenges/medium/15_sorting/challenge.py b/challenges/hard/15_sorting/challenge.py similarity index 100% rename from challenges/medium/15_sorting/challenge.py rename to challenges/hard/15_sorting/challenge.py diff --git a/challenges/medium/15_sorting/starter/starter.cu b/challenges/hard/15_sorting/starter/starter.cu similarity index 100% rename from challenges/medium/15_sorting/starter/starter.cu rename to challenges/hard/15_sorting/starter/starter.cu diff --git a/challenges/medium/15_sorting/starter/starter.cute.py b/challenges/hard/15_sorting/starter/starter.cute.py similarity index 100% rename from challenges/medium/15_sorting/starter/starter.cute.py rename to challenges/hard/15_sorting/starter/starter.cute.py diff --git a/challenges/medium/15_sorting/starter/starter.jax.py b/challenges/hard/15_sorting/starter/starter.jax.py similarity index 100% rename from challenges/medium/15_sorting/starter/starter.jax.py rename to challenges/hard/15_sorting/starter/starter.jax.py diff --git a/challenges/medium/15_sorting/starter/starter.mojo b/challenges/hard/15_sorting/starter/starter.mojo similarity index 100% rename from challenges/medium/15_sorting/starter/starter.mojo rename to challenges/hard/15_sorting/starter/starter.mojo diff --git a/challenges/medium/15_sorting/starter/starter.pytorch.py b/challenges/hard/15_sorting/starter/starter.pytorch.py similarity index 100% rename from challenges/medium/15_sorting/starter/starter.pytorch.py rename to challenges/hard/15_sorting/starter/starter.pytorch.py diff --git a/challenges/medium/15_sorting/starter/starter.triton.py b/challenges/hard/15_sorting/starter/starter.triton.py similarity index 100% rename from challenges/medium/15_sorting/starter/starter.triton.py rename to challenges/hard/15_sorting/starter/starter.triton.py diff --git a/challenges/medium/36_radix_sort/challenge.html b/challenges/hard/36_radix_sort/challenge.html similarity index 100% rename from challenges/medium/36_radix_sort/challenge.html rename to challenges/hard/36_radix_sort/challenge.html diff --git a/challenges/medium/36_radix_sort/challenge.py b/challenges/hard/36_radix_sort/challenge.py similarity index 100% rename from challenges/medium/36_radix_sort/challenge.py rename to challenges/hard/36_radix_sort/challenge.py diff --git a/challenges/medium/36_radix_sort/starter/starter.cu b/challenges/hard/36_radix_sort/starter/starter.cu similarity index 100% rename from challenges/medium/36_radix_sort/starter/starter.cu rename to challenges/hard/36_radix_sort/starter/starter.cu diff --git a/challenges/medium/36_radix_sort/starter/starter.cute.py b/challenges/hard/36_radix_sort/starter/starter.cute.py similarity index 100% rename from challenges/medium/36_radix_sort/starter/starter.cute.py rename to challenges/hard/36_radix_sort/starter/starter.cute.py diff --git a/challenges/medium/36_radix_sort/starter/starter.jax.py b/challenges/hard/36_radix_sort/starter/starter.jax.py similarity index 100% rename from challenges/medium/36_radix_sort/starter/starter.jax.py rename to challenges/hard/36_radix_sort/starter/starter.jax.py diff --git a/challenges/medium/36_radix_sort/starter/starter.mojo b/challenges/hard/36_radix_sort/starter/starter.mojo similarity index 100% rename from challenges/medium/36_radix_sort/starter/starter.mojo rename to challenges/hard/36_radix_sort/starter/starter.mojo diff --git a/challenges/medium/36_radix_sort/starter/starter.pytorch.py b/challenges/hard/36_radix_sort/starter/starter.pytorch.py similarity index 100% rename from challenges/medium/36_radix_sort/starter/starter.pytorch.py rename to challenges/hard/36_radix_sort/starter/starter.pytorch.py diff --git a/challenges/medium/36_radix_sort/starter/starter.triton.py b/challenges/hard/36_radix_sort/starter/starter.triton.py similarity index 100% rename from challenges/medium/36_radix_sort/starter/starter.triton.py rename to challenges/hard/36_radix_sort/starter/starter.triton.py diff --git a/challenges/medium/46_bfs_shortest_path/challenge.html b/challenges/hard/46_bfs_shortest_path/challenge.html similarity index 100% rename from challenges/medium/46_bfs_shortest_path/challenge.html rename to challenges/hard/46_bfs_shortest_path/challenge.html diff --git a/challenges/medium/46_bfs_shortest_path/challenge.py b/challenges/hard/46_bfs_shortest_path/challenge.py similarity index 100% rename from challenges/medium/46_bfs_shortest_path/challenge.py rename to challenges/hard/46_bfs_shortest_path/challenge.py diff --git a/challenges/medium/46_bfs_shortest_path/starter/starter.cu b/challenges/hard/46_bfs_shortest_path/starter/starter.cu similarity index 100% rename from challenges/medium/46_bfs_shortest_path/starter/starter.cu rename to challenges/hard/46_bfs_shortest_path/starter/starter.cu diff --git a/challenges/medium/46_bfs_shortest_path/starter/starter.cute.py b/challenges/hard/46_bfs_shortest_path/starter/starter.cute.py similarity index 100% rename from challenges/medium/46_bfs_shortest_path/starter/starter.cute.py rename to challenges/hard/46_bfs_shortest_path/starter/starter.cute.py diff --git a/challenges/medium/46_bfs_shortest_path/starter/starter.jax.py b/challenges/hard/46_bfs_shortest_path/starter/starter.jax.py similarity index 100% rename from challenges/medium/46_bfs_shortest_path/starter/starter.jax.py rename to challenges/hard/46_bfs_shortest_path/starter/starter.jax.py diff --git a/challenges/medium/46_bfs_shortest_path/starter/starter.mojo b/challenges/hard/46_bfs_shortest_path/starter/starter.mojo similarity index 100% rename from challenges/medium/46_bfs_shortest_path/starter/starter.mojo rename to challenges/hard/46_bfs_shortest_path/starter/starter.mojo diff --git a/challenges/medium/46_bfs_shortest_path/starter/starter.pytorch.py b/challenges/hard/46_bfs_shortest_path/starter/starter.pytorch.py similarity index 100% rename from challenges/medium/46_bfs_shortest_path/starter/starter.pytorch.py rename to challenges/hard/46_bfs_shortest_path/starter/starter.pytorch.py diff --git a/challenges/medium/46_bfs_shortest_path/starter/starter.triton.py b/challenges/hard/46_bfs_shortest_path/starter/starter.triton.py similarity index 100% rename from challenges/medium/46_bfs_shortest_path/starter/starter.triton.py rename to challenges/hard/46_bfs_shortest_path/starter/starter.triton.py diff --git a/challenges/medium/74_gpt2_block/challenge.html b/challenges/hard/74_gpt2_block/challenge.html similarity index 100% rename from challenges/medium/74_gpt2_block/challenge.html rename to challenges/hard/74_gpt2_block/challenge.html diff --git a/challenges/medium/74_gpt2_block/challenge.py b/challenges/hard/74_gpt2_block/challenge.py similarity index 100% rename from challenges/medium/74_gpt2_block/challenge.py rename to challenges/hard/74_gpt2_block/challenge.py diff --git a/challenges/medium/74_gpt2_block/starter/starter.cu b/challenges/hard/74_gpt2_block/starter/starter.cu similarity index 100% rename from challenges/medium/74_gpt2_block/starter/starter.cu rename to challenges/hard/74_gpt2_block/starter/starter.cu diff --git a/challenges/medium/74_gpt2_block/starter/starter.cute.py b/challenges/hard/74_gpt2_block/starter/starter.cute.py similarity index 100% rename from challenges/medium/74_gpt2_block/starter/starter.cute.py rename to challenges/hard/74_gpt2_block/starter/starter.cute.py diff --git a/challenges/medium/74_gpt2_block/starter/starter.jax.py b/challenges/hard/74_gpt2_block/starter/starter.jax.py similarity index 100% rename from challenges/medium/74_gpt2_block/starter/starter.jax.py rename to challenges/hard/74_gpt2_block/starter/starter.jax.py diff --git a/challenges/medium/74_gpt2_block/starter/starter.mojo b/challenges/hard/74_gpt2_block/starter/starter.mojo similarity index 100% rename from challenges/medium/74_gpt2_block/starter/starter.mojo rename to challenges/hard/74_gpt2_block/starter/starter.mojo diff --git a/challenges/medium/74_gpt2_block/starter/starter.pytorch.py b/challenges/hard/74_gpt2_block/starter/starter.pytorch.py similarity index 100% rename from challenges/medium/74_gpt2_block/starter/starter.pytorch.py rename to challenges/hard/74_gpt2_block/starter/starter.pytorch.py diff --git a/challenges/medium/74_gpt2_block/starter/starter.triton.py b/challenges/hard/74_gpt2_block/starter/starter.triton.py similarity index 100% rename from challenges/medium/74_gpt2_block/starter/starter.triton.py rename to challenges/hard/74_gpt2_block/starter/starter.triton.py diff --git a/challenges/hard/11_3d_convolution/challenge.html b/challenges/medium/11_3d_convolution/challenge.html similarity index 100% rename from challenges/hard/11_3d_convolution/challenge.html rename to challenges/medium/11_3d_convolution/challenge.html diff --git a/challenges/hard/11_3d_convolution/challenge.py b/challenges/medium/11_3d_convolution/challenge.py similarity index 100% rename from challenges/hard/11_3d_convolution/challenge.py rename to challenges/medium/11_3d_convolution/challenge.py diff --git a/challenges/hard/11_3d_convolution/starter/starter.cu b/challenges/medium/11_3d_convolution/starter/starter.cu similarity index 100% rename from challenges/hard/11_3d_convolution/starter/starter.cu rename to challenges/medium/11_3d_convolution/starter/starter.cu diff --git a/challenges/hard/11_3d_convolution/starter/starter.cute.py b/challenges/medium/11_3d_convolution/starter/starter.cute.py similarity index 100% rename from challenges/hard/11_3d_convolution/starter/starter.cute.py rename to challenges/medium/11_3d_convolution/starter/starter.cute.py diff --git a/challenges/hard/11_3d_convolution/starter/starter.jax.py b/challenges/medium/11_3d_convolution/starter/starter.jax.py similarity index 100% rename from challenges/hard/11_3d_convolution/starter/starter.jax.py rename to challenges/medium/11_3d_convolution/starter/starter.jax.py diff --git a/challenges/hard/11_3d_convolution/starter/starter.mojo b/challenges/medium/11_3d_convolution/starter/starter.mojo similarity index 100% rename from challenges/hard/11_3d_convolution/starter/starter.mojo rename to challenges/medium/11_3d_convolution/starter/starter.mojo diff --git a/challenges/hard/11_3d_convolution/starter/starter.pytorch.py b/challenges/medium/11_3d_convolution/starter/starter.pytorch.py similarity index 100% rename from challenges/hard/11_3d_convolution/starter/starter.pytorch.py rename to challenges/medium/11_3d_convolution/starter/starter.pytorch.py diff --git a/challenges/hard/11_3d_convolution/starter/starter.triton.py b/challenges/medium/11_3d_convolution/starter/starter.triton.py similarity index 100% rename from challenges/hard/11_3d_convolution/starter/starter.triton.py rename to challenges/medium/11_3d_convolution/starter/starter.triton.py diff --git a/challenges/easy/43_count_array_element/challenge.html b/challenges/medium/43_count_array_element/challenge.html similarity index 100% rename from challenges/easy/43_count_array_element/challenge.html rename to challenges/medium/43_count_array_element/challenge.html diff --git a/challenges/easy/43_count_array_element/challenge.py b/challenges/medium/43_count_array_element/challenge.py similarity index 100% rename from challenges/easy/43_count_array_element/challenge.py rename to challenges/medium/43_count_array_element/challenge.py diff --git a/challenges/medium/43_count_array_element/starter/starter.cu b/challenges/medium/43_count_array_element/starter/starter.cu new file mode 100644 index 00000000..8c64ce6d --- /dev/null +++ b/challenges/medium/43_count_array_element/starter/starter.cu @@ -0,0 +1,4 @@ +#include + +// input, output are device pointers +extern "C" void solve(const int* input, int* output, int N, int K) {} diff --git a/challenges/easy/43_count_array_element/starter/starter.cute.py b/challenges/medium/43_count_array_element/starter/starter.cute.py similarity index 100% rename from challenges/easy/43_count_array_element/starter/starter.cute.py rename to challenges/medium/43_count_array_element/starter/starter.cute.py diff --git a/challenges/easy/43_count_array_element/starter/starter.jax.py b/challenges/medium/43_count_array_element/starter/starter.jax.py similarity index 100% rename from challenges/easy/43_count_array_element/starter/starter.jax.py rename to challenges/medium/43_count_array_element/starter/starter.jax.py diff --git a/challenges/medium/43_count_array_element/starter/starter.mojo b/challenges/medium/43_count_array_element/starter/starter.mojo new file mode 100644 index 00000000..975790d0 --- /dev/null +++ b/challenges/medium/43_count_array_element/starter/starter.mojo @@ -0,0 +1,9 @@ +from gpu.host import DeviceContext +from gpu.id import block_dim, block_idx, thread_idx +from memory import UnsafePointer +from math import ceildiv + +# input, output are device pointers +@export +def solve(input: UnsafePointer[Int32], output: UnsafePointer[Int32], N: Int32, K: Int32): + pass diff --git a/challenges/easy/43_count_array_element/starter/starter.pytorch.py b/challenges/medium/43_count_array_element/starter/starter.pytorch.py similarity index 100% rename from challenges/easy/43_count_array_element/starter/starter.pytorch.py rename to challenges/medium/43_count_array_element/starter/starter.pytorch.py diff --git a/challenges/medium/43_count_array_element/starter/starter.triton.py b/challenges/medium/43_count_array_element/starter/starter.triton.py new file mode 100644 index 00000000..7285bde2 --- /dev/null +++ b/challenges/medium/43_count_array_element/starter/starter.triton.py @@ -0,0 +1,8 @@ +import torch +import triton +import triton.language as tl + + +# input, output are tensors on the GPU +def solve(input: torch.Tensor, output: torch.Tensor, N: int, K: int): + pass diff --git a/challenges/easy/44_count_2d_array_element/challenge.html b/challenges/medium/44_count_2d_array_element/challenge.html similarity index 100% rename from challenges/easy/44_count_2d_array_element/challenge.html rename to challenges/medium/44_count_2d_array_element/challenge.html diff --git a/challenges/easy/44_count_2d_array_element/challenge.py b/challenges/medium/44_count_2d_array_element/challenge.py similarity index 100% rename from challenges/easy/44_count_2d_array_element/challenge.py rename to challenges/medium/44_count_2d_array_element/challenge.py diff --git a/challenges/medium/44_count_2d_array_element/starter/starter.cu b/challenges/medium/44_count_2d_array_element/starter/starter.cu new file mode 100644 index 00000000..347364e6 --- /dev/null +++ b/challenges/medium/44_count_2d_array_element/starter/starter.cu @@ -0,0 +1,4 @@ +#include + +// input, output are device pointers +extern "C" void solve(const int* input, int* output, int N, int M, int K) {} diff --git a/challenges/easy/44_count_2d_array_element/starter/starter.cute.py b/challenges/medium/44_count_2d_array_element/starter/starter.cute.py similarity index 100% rename from challenges/easy/44_count_2d_array_element/starter/starter.cute.py rename to challenges/medium/44_count_2d_array_element/starter/starter.cute.py diff --git a/challenges/easy/44_count_2d_array_element/starter/starter.jax.py b/challenges/medium/44_count_2d_array_element/starter/starter.jax.py similarity index 100% rename from challenges/easy/44_count_2d_array_element/starter/starter.jax.py rename to challenges/medium/44_count_2d_array_element/starter/starter.jax.py diff --git a/challenges/medium/44_count_2d_array_element/starter/starter.mojo b/challenges/medium/44_count_2d_array_element/starter/starter.mojo new file mode 100644 index 00000000..851b4d9f --- /dev/null +++ b/challenges/medium/44_count_2d_array_element/starter/starter.mojo @@ -0,0 +1,9 @@ +from gpu.host import DeviceContext +from gpu.id import block_dim, block_idx, thread_idx +from memory import UnsafePointer +from math import ceildiv + +# input, output are device pointers +@export +def solve(input: UnsafePointer[Int32], output: UnsafePointer[Int32], N: Int32, M: Int32, K: Int32): + pass diff --git a/challenges/easy/44_count_2d_array_element/starter/starter.pytorch.py b/challenges/medium/44_count_2d_array_element/starter/starter.pytorch.py similarity index 100% rename from challenges/easy/44_count_2d_array_element/starter/starter.pytorch.py rename to challenges/medium/44_count_2d_array_element/starter/starter.pytorch.py diff --git a/challenges/easy/44_count_2d_array_element/starter/starter.triton.py b/challenges/medium/44_count_2d_array_element/starter/starter.triton.py similarity index 100% rename from challenges/easy/44_count_2d_array_element/starter/starter.triton.py rename to challenges/medium/44_count_2d_array_element/starter/starter.triton.py