Perform the Leaky ReLU (Leaky Rectified Linear Unit) activation function on an input matrix:
C[i][j]=max(α⋅A[i][j],A[i][j])
where α is a small positive constant (e.g. 0.01)
The Leaky ReLU function is defined as:
f(x)={xαxif x>0if x≤0
Input:
- Matrix A of size M×N
- α value (slope for negative values)
Output:
- Matrix C of size M×N
Notes:
- Both matrices A and C are stored in row-major order
- This problem is adapted from KernelBench
Test Case Sizes
- 4096x4096, alpha=0.01
- 4096x4096, alpha=0.05
- 4096x4096, alpha=0.1
- 4096x4096, alpha=0.2
- 6144x4096, alpha=0.01
- 6144x4096, alpha=0.05
- 6144x4096, alpha=0.1
- 6144x4096, alpha=0.2