HEaaN GPU Component Overview
Component Structure

Component Roles
Component
Layer
Responsibility
Key Features
Devices.hpp
High-level
Device abstraction and management
Device type management
Device state control
Scope-based device switching
CudaTools.hpp
Low-level
CUDA runtime interface
CUDA device operations
Memory Management
Profiling support
Example flow
// High-level usage (Device.hpp)
Device gpuDevice(DeviceType::GPU);
{
scopedCudaDeviceSelector selector(gpuDevice);
// Device.hpp internally uses CudaTools.hpp
// to manage CUDA device
}
// Low-level usage (CudaTools.hpp)
if(HEaaN::CudaTools::isAvailable()) {
HEaaN::CudaTools::cudaSetDevice(0);
// ...
HEaaN::CudaTools::cudaDeviceSynchronize();
}
Last updated
Was this helpful?