CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pycuda

Python wrapper for Nvidia CUDA parallel computation API with object cleanup, automatic error checking, and convenient abstractions.

62

0.93x
Overview
Eval results
Files

rubric.jsonevals/scenario-6/

{
  "context": "This criteria evaluates the engineer's proficiency in using PyCUDA's GPUArray for element-wise arithmetic operations. The focus is on proper usage of GPUArray creation, arithmetic operators, and GPU-CPU data transfer patterns.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "GPUArray creation",
      "description": "Uses pycuda.gpuarray.to_gpu() or pycuda.gpuarray.GPUArray() to transfer NumPy arrays to GPU memory for computation.",
      "max_score": 15
    },
    {
      "name": "Element-wise arithmetic",
      "description": "Uses GPUArray arithmetic operators (+, -, *, /, **) for element-wise operations on GPU arrays rather than computing on CPU.",
      "max_score": 25
    },
    {
      "name": "Magnitude calculation",
      "description": "Computes vector magnitude using GPUArray operations: squares x and y components (using ** or *), adds them (+), and computes square root (using pycuda.cumath.sqrt or **0.5).",
      "max_score": 20
    },
    {
      "name": "Vector normalization",
      "description": "Implements normalization by dividing vector components by magnitude using GPUArray division operator (/). Handles zero-magnitude vectors appropriately using comparison operators or conditional operations.",
      "max_score": 20
    },
    {
      "name": "GPU-CPU transfer",
      "description": "Retrieves results from GPU to CPU using the .get() method on GPUArray objects to return NumPy arrays.",
      "max_score": 15
    },
    {
      "name": "Context initialization",
      "description": "Properly initializes CUDA context using pycuda.autoinit or manual context creation with pycuda.driver.Device and pycuda.driver.Context.",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-pycuda

tile.json