Forum

Top 20 API Calls fr…
 
Notifications
Clear all

Top 20 API Calls from Nvidia CUDA

1 Posts
1 Users
0 Reactions
9 Views
 josh
(@josh)
Member Admin
Joined: 2 months ago
Posts: 510
Topic starter  

Here are the **top 20 essential NVIDIA CUDA API calls** that are commonly used in CUDA programming, covering initialization, memory management, kernel launches, synchronization, and cleanup:

1. **cudaGetDeviceCount** — Returns the number of CUDA-capable devices present in the system.
2. **cudaSetDevice** — Sets the current device for subsequent CUDA operations.
3. **cudaMalloc** — Allocates device (GPU) memory.
4. **cudaFree** — Frees device memory.
5. **cudaMemcpy** — Copies data between host and device memory.
6. **cudaMemcpyAsync** — Asynchronous copy between host and device.
7. **cudaStreamCreate** — Creates a CUDA stream for asynchronous operations.
8. **cudaStreamDestroy** — Destroys a CUDA stream.
9. **cudaEventCreate** — Creates an event for synchronization.
10. **cudaEventRecord** — Records an event in a stream for synchronization purposes.
11. **cudaEventSynchronize** — Waits for an event to complete.
12. **cudaDeviceSynchronize** — Waits until the device has completed all preceding tasks.
13. **cuModuleLoad / cuModuleGetFunction** — Loads a CUDA module (PTX or cubin) and retrieves a kernel function.
14. **cuLaunchKernel** — Launches a CUDA kernel with specified grid/block dimensions.
15. **cudaDeviceReset** — Resets the device, cleaning up resources.
16. **cudaGetLastError** — Checks for errors after CUDA calls.
17. **cudaStreamQuery** — Checks if all tasks in a stream are complete.
18. **cudaProfilerStart / cudaProfilerStop** — Controls profiling of CUDA code.
19. **cudaDeviceGetAttribute** — Retrieves device attributes (compute capability, etc.).
20. **cudaDeviceGetProperties** — Gets properties of the CUDA device (name, total memory, etc.).


   
Quote
Share: