con un clic
paracodex-cuda-ocl-step1
ParaCodex prompt for cuda ocl step1 step.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
ParaCodex prompt for cuda ocl step1 step.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
ParaCodex baseline skill: translate serial / parallel code to GPU-offloaded target API, optimize, compile, and run — all in a single session.
ParaCodex prompt for cuda to hip analysis step.
ParaCodex prompt for cuda to hip step1 (implementation) step.
ParaCodex prompt for cuda to hip step2 (optimization) step.
ParaCodex prompt for cuda ocl analysis step.
ParaCodex prompt for cuda ocl step2 step.
| name | paracodex-cuda-ocl-step1 |
| description | ParaCodex prompt for cuda ocl step1 step. |
Directory: {kernel_dir}/
Files: {file_listing}
Reference: {kernel_dir}/analysis.md
Required:
Structural Goal: Choose the kernel/program split that gives the best end-to-end OpenCL implementation, not necessarily the most literal CUDA translation.
# Baseline CUDA output is in baseline_output.txt in {kernel_dir}/
MANDATORY: Create opencl_migration_plan.md in {kernel_dir} using template in references/output.md.
Reference: references/examples.md (Syntax Conversion, Math Functions, etc.).
Analyze analysis.md and mapped files to fill the plan.
system_info_summary.txt; prefer the largest short-run, memory-safe input that should load the GPU meaningfully on this device, not merely a token size increase.__global__, __device__, __shared__ to OpenCL keywords.threadIdx → get_local_id).__syncthreads() and atomics.references/examples.md (Common Syntax).// Check support first
cl_bool ooo_support;
clGetDeviceInfo(device, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, sizeof(cl_bool), &ooo_support, NULL);
// Note: CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE is a property bit, check via:
cl_command_queue_properties queue_props;
clGetDeviceInfo(device, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES,
sizeof(cl_command_queue_properties), &queue_props, NULL);
cl_bool supports_ooo = (queue_props & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) != 0;
cl_queue_properties props[] = {CL_QUEUE_PROPERTIES,
supports_ooo ? CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE : 0, 0};
queue = clCreateCommandQueueWithProperties(ctx, device, props, &err);
cudaMalloc/cudaMemcpy with clCreateBuffer/clEnqueueWriteBuffer.CL_MEM_ALLOC_HOST_PTR on host-side buffers for pinned memory and faster H↔D transfers.clSetKernelArg + clEnqueueNDRangeKernel.cl_event objects to express dependencies between transfers and kernels instead of clFinish.references/examples.md (Setup Boilerplate & Memory mapping).references/output.md checklist.CL_CHECK).<RUN_ARGS>, <PROGRAM_NAME>, <SOURCE_FILES>, etc.) with real values.{clean_cmd_str}
{build_cmd_str}
timeout 300 {run_cmd_str} > opencl_output.txt 2>&1
Debug Issues: (See references/examples.md for Common Issues)
clGetProgramBuildInfo).diff baseline_output.txt opencl_output.txt
{clean_cmd_str}
{profile_cmd_str} > {profile_log_path} 2>&1
{nsys_profile_cmd} > {profile_log_path} 2>&1 produces GPU kernel information in the log.