File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,3 +29,36 @@ CUresult cuDriverGetVersion(int *driverVersion) {
2929CUresult cuCtxSynchronize (void ) {
3030 return CUDA_SUCCESS ;
3131}
32+
33+ // Mock cuCtxGetDevice — return a fixed device id for the parcagpu
34+ // gpu_config probe path.
35+ CUresult cuCtxGetDevice (CUdevice * device ) {
36+ if (device == NULL ) {
37+ return CUDA_ERROR_INVALID_VALUE ;
38+ }
39+ * device = 0 ;
40+ return CUDA_SUCCESS ;
41+ }
42+
43+ // Mock cuDeviceGetAttribute — return plausible H100-class values for the
44+ // attributes parcagpu queries at context init. Anything not enumerated
45+ // returns 0 (still success), so callers see a non-error but inert value.
46+ CUresult cuDeviceGetAttribute (int * pi , CUdevice_attribute attrib ,
47+ CUdevice dev ) {
48+ (void )dev ;
49+ if (pi == NULL ) {
50+ return CUDA_ERROR_INVALID_VALUE ;
51+ }
52+ switch (attrib ) {
53+ case CU_DEVICE_ATTRIBUTE_CLOCK_RATE :
54+ * pi = 1830000 ; // 1.83 GHz, H100 boost
55+ break ;
56+ case CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT :
57+ * pi = 132 ; // H100 SXM5
58+ break ;
59+ default :
60+ * pi = 0 ;
61+ break ;
62+ }
63+ return CUDA_SUCCESS ;
64+ }
You can’t perform that action at this time.
0 commit comments