ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
cuda_runtime_api.h
Go to the documentation of this file.
1#ifndef _CUDA_RUNTIME_API_H
2# define _CUDA_RUNTIME_API_H 1
3
4# include "driver_types.h"
5# include "host_defines.h"
6# include "builtin_types.h"
8# include "sm_atomic_functions.h"
9# include "cuda_error.h"
10# include "call_kernel.h"
11
12# include <stddef.h>
13# include <stdio.h>
14# include <cstdlib>
15
17# if !defined(__dv)
18
19# if defined(__cplusplus)
20
21# define __dv(v)
22
23# else /* __cplusplus */
24
25# define __dv(v)
26
27# endif /* __cplusplus */
28
29# endif /* !__dv */
31
33__cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind)
34{
35 __ESBMC_atomic_begin();
36 __ESBMC_assert(count > 0, "Size to be allocated may not be less than zero");
37
38 char *cdst = (char *)dst;
39 const char *csrc = (const char *)src;
40 int numbytes = count / (sizeof(char));
41
42 for (int i = 0; i < numbytes; i++)
43 cdst[i] = csrc[i];
44
46 __ESBMC_atomic_end();
47 return CUDA_SUCCESS;
48}
49
50template <class T1, class T2>
51cudaError_t cudaMemcpy(T1 dst, T2 src, size_t count, enum cudaMemcpyKind kind)
52{
53 return __cudaMemcpy(dst, src, count, kind);
54}
55
56cudaError_t cudaMalloc(void **devPtr, size_t size)
57{
58 __ESBMC_atomic_begin();
59 cudaError_t tmp;
60 // pre-conditions
61 __ESBMC_assert(size > 0, "Size to be allocated may not be less than zero");
62 *devPtr = malloc(size);
63
64 if (*devPtr == NULL)
66 else
67 {
68 __cudaDeviceOf[__ESBMC_POINTER_OBJECT(*devPtr)] = __cudaCurrentDevice + 1;
69 tmp = CUDA_SUCCESS;
70 }
71
72 // post-conditions
73 __ESBMC_assert(tmp == CUDA_SUCCESS, "Memory was not allocated");
74
75 lastError = tmp;
76 __ESBMC_atomic_end();
77 return tmp;
78}
79
80cudaError_t cudaFree(void *devPtr)
81{
82 __ESBMC_atomic_begin();
83 free(devPtr);
85 __ESBMC_atomic_end();
86 return CUDA_SUCCESS;
87}
88
90{
91 char *erroReturn;
92
93 switch (error)
94 {
95 case 0:
96 return "CUDA_SUCCESS";
97 break;
98 case 1:
99 return "CUDA_ERROR_INVALID_VALUE";
100 break;
101 case 2:
102 return "CUDA_ERROR_OUT_OF_MEMORY";
103 break;
104 case 3:
105 return "CUDA_ERROR_NOT_INITIALIZED";
106 break;
107 case 4:
108 return "CUDA_ERROR_DEINITIALIZED";
109 break;
110 case 5:
111 return "CUDA_ERROR_PROFILER_DISABLED";
112 break;
113 case 6:
114 return "CUDA_ERROR_PROFILER_NOT_INITIALIZED";
115 break;
116 case 7:
117 return "CUDA_ERROR_PROFILER_ALREADY_STARTED";
118 break;
119 case 8:
120 return "CUDA_ERROR_PROFILER_ALREADY_STOPPED";
121 break;
122 case 100:
123 return "CUDA_ERROR_NO_DEVICE";
124 break;
125 case 101:
126 return "CUDA_ERROR_INVALID_DEVICE";
127 break;
128 case 200:
129 return "CUDA_ERROR_INVALID_IMAGE";
130 break;
131 case 201:
132 return "CUDA_ERROR_INVALID_CONTEXT";
133 break;
134 case 202:
135 return "CUDA_ERROR_CONTEXT_ALREADY_CURRENT";
136 break;
137 case 205:
138 return "CUDA_ERROR_MAP_FAILED";
139 break;
140 case 206:
141 return "CUDA_ERROR_UNMAP_FAILED";
142 break;
143 case 207:
144 return "CUDA_ERROR_ARRAY_IS_MAPPED";
145 break;
146 case 208:
147 return "CUDA_ERROR_ALREADY_MAPPED";
148 break;
149 case 209:
150 return "CUDA_ERROR_NO_BINARY_FOR_GPU";
151 break;
152 case 210:
153 return "CUDA_ERROR_ALREADY_ACQUIRED";
154 break;
155 case 211:
156 return "CUDA_ERROR_NOT_MAPPED";
157 break;
158 case 212:
159 return "CUDA_ERROR_NOT_MAPPED_AS_ARRAY";
160 break;
161 case 213:
162 return "CUDA_ERROR_NOT_MAPPED_AS_POINTER";
163 break;
164 case 214:
165 return "CUDA_ERROR_ECC_UNCORRECTABLE";
166 break;
167 case 215:
168 return "CUDA_ERROR_UNSUPPORTED_LIMIT";
169 break;
170 case 216:
171 return "CUDA_ERROR_CONTEXT_ALREADY_IN_USE";
172 break;
173 case 217:
174 return "CUDA_ERROR_PEER_ACCESS_UNSUPPORTED";
175 break;
176 case 218:
177 return "CUDA_ERROR_INVALID_PTX";
178 break;
179 case 219:
180 return "CUDA_ERROR_INVALID_GRAPHICS_CONTEXT";
181 break;
182 case 300:
183 return "CUDA_ERROR_INVALID_SOURCE";
184 break;
185 case 301:
186 return "CUDA_ERROR_FILE_NOT_FOUND";
187 break;
188 case 302:
189 return "CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND";
190 break;
191 case 303:
192 return "CUDA_ERROR_SHARED_OBJECT_INIT_FAILED";
193 break;
194 case 304:
195 return "CUDA_ERROR_OPERATING_SYSTEM";
196 break;
197 case 400:
198 return "CUDA_ERROR_INVALID_HANDLE";
199 break;
200 case 500:
201 return "CUDA_ERROR_NOT_FOUND";
202 break;
203 case 600:
204 return "CUDA_ERROR_NOT_READY";
205 break;
206 case 700:
207 return "CUDA_ERROR_ILLEGAL_ADDRESS";
208 break;
209 case 701:
210 return "CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES";
211 break;
212 case 702:
213 return "CUDA_ERROR_LAUNCH_TIMEOUT";
214 break;
215 case 703:
216 return "CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING";
217 break;
218 case 704:
219 return "CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED";
220 break;
221 case 705:
222 return "CUDA_ERROR_PEER_ACCESS_NOT_ENABLED";
223 break;
224 case 708:
225 return "CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE";
226 break;
227 case 709:
228 return "CUDA_ERROR_CONTEXT_IS_DESTROYED";
229 break;
230 case 710:
231 return "CUDA_ERROR_ASSERT";
232 break;
233 case 711:
234 return "CUDA_ERROR_TOO_MANY_PEERS";
235 break;
236 case 712:
237 return "CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED";
238 break;
239 case 713:
240 return "CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED";
241 break;
242 case 714:
243 return "CUDA_ERROR_HARDWARE_STACK_ERROR";
244 break;
245 case 715:
246 return "CUDA_ERROR_ILLEGAL_INSTRUCTION";
247 break;
248 case 716:
249 return "CUDA_ERROR_MISALIGNED_ADDRESS";
250 break;
251 case 717:
252 return "CUDA_ERROR_INVALID_ADDRESS_SPACE";
253 break;
254 case 718:
255 return "CUDA_ERROR_INVALID_PC";
256 break;
257 case 719:
258 return "CUDA_ERROR_LAUNCH_FAILED";
259 break;
260 case 800:
261 return "CUDA_ERROR_NOT_PERMITTED";
262 break;
263 case 801:
264 return "CUDA_ERROR_NOT_SUPPORTED";
265 break;
266 case 999:
267 return "CUDA_ERROR_UNKNOWN";
268 break;
269 default:
270 return "CUDA_SUCCESS";
271 }
272}
273
276
277// Struct to Device - OK
285
287
288// Insert a device
289void cudaDeviceInsert(int device)
290{
291 cudaDeviceList_t *auxDevice = cudaDeviceList;
292
293 // Verifies that the device exists in the list
294 while (auxDevice != NULL)
295 {
296 if (auxDevice->id == device)
297 {
298 // printf("\nDevice existing");
299 // return 0;
300 }
301 auxDevice = auxDevice->prox;
302 }
303 // Insert new device
304 cudaDeviceList_t *newCudaDevice;
305
306 newCudaDevice = (cudaDeviceList_t *)__ESBMC_alloca(sizeof(cudaDeviceList_t));
307 if (newCudaDevice == NULL)
308 return;
309
310 newCudaDevice->id = device;
311 newCudaDevice->active = 0;
312 // newCudaDevice->deviceProp.regsPerBlock = var; //Insert fields to deviceProp
313 newCudaDevice->prox = NULL;
314
315 if (cudaDeviceList == NULL)
316 {
317 cudaDeviceList = newCudaDevice;
318 }
319 else
320 {
321 newCudaDevice->prox = cudaDeviceList;
322 cudaDeviceList = newCudaDevice;
323 }
324 // return 1;
325}
326
327// Searching for a device in the devices list
329{
330 // printf("\n\n*** CUDA Device\n");
331 __ESBMC_atomic_begin();
332 cudaDeviceList_t *auxDevice = cudaDeviceList;
333
334 while (auxDevice != NULL)
335 {
336 // printf("->Device: %d Active:%d\n",auxDevice->id,auxDevice->active);
337 auxDevice = auxDevice->prox;
338 }
339 __ESBMC_atomic_end();
340}
341
342// Searching for a device in the devices list
343int searchCudaDevice(int device)
344{
345 cudaDeviceList_t *auxDevice = cudaDeviceList;
346
347 while (auxDevice != NULL)
348 {
349 if (auxDevice->id == device)
350 {
351 return 1;
352 }
353 else
354 {
355 auxDevice = auxDevice->prox;
356 }
357 }
358 return 0;
359}
360
361// Checks whether the device is in use
362int cudaDeviceActive(int device)
363{
364 cudaDeviceList_t *auxDevice = cudaDeviceList;
365
366 while (auxDevice != NULL)
367 {
368 if (auxDevice->id == device)
369 {
370 if (auxDevice->active == 1)
371 {
372 return 1;
373 }
374 else
375 {
376 return 0;
377 }
378 }
379 }
380 return 0;
381}
382
383// Start a device
384int cudaDeviceStart(int device)
385{
386 cudaDeviceList_t *auxDevice = cudaDeviceList;
387
388 while (auxDevice != NULL)
389 {
390 if (auxDevice->id == device)
391 {
392 auxDevice->active = 1;
393 return 1;
394 }
395 auxDevice = auxDevice->prox;
396 }
397 return 0;
398}
399
400// Choose a device to work
402{
403 if (device < 0 || device >= __cudaDeviceCount)
404 {
407 }
408 __cudaCurrentDevice = device;
410 return cudaSuccess;
411}
412
413// Returns the number of compute-capable devices.
420
421// Destroy all allocations and reset all state on the current device in the
422// current process.
424{
425 /*
426 int tmp;
427 threadsList_t *node;
428
429 while(cudaThreadList != NULL){
430 // pthread_exit(cudaThreadList->thread);
431 node = cudaThreadList;
432 cudaThreadList = cudaThreadList->prox;
433 free(node);
434 }
435
436 lastError = cudaSuccess;
437 */
438 return cudaSuccess;
439}
440
441/*
442 * Memory Management
443 */
445 const void *symbol,
446 const void *src,
447 size_t count,
448 size_t offset __dv(0),
450{
451 __ESBMC_atomic_begin();
452 cudaError_t out;
453
454 out = __cudaMemcpy((void *)(symbol), (const void *)src, count, kind);
455
456 lastError = out;
457 __ESBMC_atomic_end();
458 return out;
459}
460
462 void *dst,
463 const void *symbol,
464 size_t count,
465 size_t offset __dv(0),
467{
468 __ESBMC_atomic_begin();
469 cudaError_t out;
470
471 out = __cudaMemcpy((void *)dst, (const void *)(symbol), count, kind);
472
473 lastError = out;
474 __ESBMC_atomic_end();
475 return out;
476}
477
478extern __host__ cudaError_t CUDARTAPI cudaSetDevice(int device);
479
481cudaGetDeviceProperties(struct cudaDeviceProp *prop, int device);
482
483extern cudaError_t
485{
486 struct cudaDeviceProp deviceChosen;
487
488 int out;
489
490 cudaDeviceList_t *auxDevice = cudaDeviceList;
491
492 while (auxDevice != NULL)
493 {
494 if (auxDevice->id == device)
495 {
496 deviceChosen = auxDevice->deviceProp;
497 prop = &deviceChosen;
498 return cudaSuccess;
499 }
500 auxDevice = auxDevice->prox;
501 }
503}
504
506{
507 return lastError;
508}
509
510typedef struct threadsList
511{
513 struct threadsList *prox;
515
517
519{
520 __ESBMC_atomic_begin();
521 cudaError_t tmp;
522
523 while (cudaThreadList != NULL)
524 {
525 threadsList_t *node;
527 node = cudaThreadList;
529 free(node);
530 }
532 __ESBMC_atomic_end();
533 return CUDA_SUCCESS;
534}
535
537cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device)
538{
540 return CUDA_SUCCESS;
541}
542
544{
546 return CUDA_SUCCESS;
547}
548
554
560
562{
564 return CUDA_SUCCESS;
565}
566
568{
569}
570
572{
573}
574
577
579cudaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority);
580
581extern __host__ cudaError_t CUDARTAPI
582cudaDeviceGetByPCIBusId(int *device, const char *pciBusId);
583
584extern __host__ cudaError_t CUDARTAPI
585cudaDeviceGetPCIBusId(char *pciBusId, int len, int device);
586
587extern __host__ cudaError_t CUDARTAPI cudaIpcCloseMemHandle(void *devPtr);
588
589extern __host__ cudaError_t CUDARTAPI cudaThreadExit(void);
590
593
594extern __host__ __cudart_builtin__ const char *CUDARTAPI
596
597extern __host__ __cudart_builtin__ const char *CUDARTAPI
599
601cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device);
602
603extern __host__ cudaError_t CUDARTAPI
604cudaChooseDevice(int *device, const struct cudaDeviceProp *prop);
605
607cudaGetDevice(int *device);
608
609extern __host__ cudaError_t CUDARTAPI
610cudaSetValidDevices(int *device_arr, int len);
611
612extern __host__ cudaError_t CUDARTAPI cudaSetDeviceFlags(unsigned int flags);
613
615
617cudaEventCreateWithFlags(cudaEvent_t *event, unsigned int flags);
618
620
622
625
626extern __host__ cudaError_t CUDARTAPI
628
629extern __host__ cudaError_t CUDARTAPI
630cudaSetupArgument(const void *arg, size_t size, size_t offset);
631
632extern __host__ cudaError_t CUDARTAPI cudaLaunch(const void *func);
633
635cudaFuncGetAttributes(struct cudaFuncAttributes *attr, const void *func);
636
637extern __host__ cudaError_t CUDARTAPI cudaSetDoubleForDevice(double *d);
638
639extern __host__ cudaError_t CUDARTAPI cudaSetDoubleForHost(double *d);
640
642cudaMallocManaged(void **devPtr, size_t size, unsigned int flags);
643
644extern __host__ cudaError_t CUDARTAPI cudaMallocHost(void **ptr, size_t size);
645
646extern __host__ cudaError_t CUDARTAPI
647cudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height);
648
649extern __host__ cudaError_t CUDARTAPI cudaFreeHost(void *ptr);
650
651extern __host__ cudaError_t CUDARTAPI
652cudaHostAlloc(void **pHost, size_t size, unsigned int flags);
653
654extern __host__ cudaError_t CUDARTAPI
655cudaHostRegister(void *ptr, size_t size, unsigned int flags);
656
657extern __host__ cudaError_t CUDARTAPI cudaHostUnregister(void *ptr);
658
659extern __host__ cudaError_t CUDARTAPI
660cudaHostGetDevicePointer(void **pDevice, void *pHost, unsigned int flags);
661
662extern __host__ cudaError_t CUDARTAPI
663cudaHostGetFlags(unsigned int *pFlags, void *pHost);
664
665extern __host__ cudaError_t CUDARTAPI
666cudaMalloc3D(struct cudaPitchedPtr *pitchedDevPtr, struct cudaExtent extent);
667
668extern __host__ cudaError_t CUDARTAPI
669cudaMemcpy3D(const struct cudaMemcpy3DParms *p);
670
671extern __host__ cudaError_t CUDARTAPI
672cudaMemcpy3DPeer(const struct cudaMemcpy3DPeerParms *p);
673
674extern __host__ cudaError_t CUDARTAPI
675cudaMemGetInfo(size_t *free, size_t *total);
676
678 void *dst,
679 int dstDevice,
680 const void *src,
681 int srcDevice,
682 size_t count);
683
685 void *dst,
686 size_t dpitch,
687 const void *src,
688 size_t spitch,
689 size_t width,
690 size_t height,
691 enum cudaMemcpyKind kind);
692
693extern __host__ cudaError_t CUDARTAPI
694cudaMemset(void *devPtr, int value, size_t count);
695
697 void *devPtr,
698 size_t pitch,
699 int value,
700 size_t width,
701 size_t height);
702
704 struct cudaPitchedPtr pitchedDevPtr,
705 int value,
706 struct cudaExtent extent);
707
708extern __host__ cudaError_t CUDARTAPI
709cudaGetSymbolAddress(void **devPtr, const void *symbol);
710
711extern __host__ cudaError_t CUDARTAPI
712cudaGetSymbolSize(size_t *size, const void *symbol);
713
715 struct cudaPointerAttributes *attributes,
716 const void *ptr);
717
718// The model does not know the platform's peer topology.
720cudaDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice)
721{
722 if (
723 device < 0 || device >= __cudaDeviceCount || peerDevice < 0 ||
724 peerDevice >= __cudaDeviceCount)
725 {
728 }
729 *canAccessPeer = nondet_bool();
731 return cudaSuccess;
732}
733
734// Access is one-way: from the current device to peerDevice only.
735cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags)
736{
737 if (flags != 0)
738 {
741 }
742 if (
743 peerDevice < 0 || peerDevice >= __cudaDeviceCount ||
744 peerDevice == __cudaCurrentDevice)
745 {
748 }
749 const unsigned int pair = __cudaPeerIndex(__cudaCurrentDevice, peerDevice);
750 if (__cudaPeerAccess[pair])
751 {
754 }
755 // Whether the current device can reach peerDevice is platform-dependent.
756 if (nondet_bool())
757 {
760 }
761 __cudaPeerAccess[pair] = 1;
763 return cudaSuccess;
764}
765
767{
768 if (peerDevice < 0 || peerDevice >= __cudaDeviceCount)
769 {
772 }
773 const unsigned int pair = __cudaPeerIndex(__cudaCurrentDevice, peerDevice);
774 if (!__cudaPeerAccess[pair])
775 {
778 }
779 __cudaPeerAccess[pair] = 0;
781 return cudaSuccess;
782}
783
785 size_t *offset,
786 const struct textureReference *texref,
787 const void *devPtr,
788 const struct cudaChannelFormatDesc *desc,
789 size_t size __dv(UINT_MAX));
790
792 size_t *offset,
793 const struct textureReference *texref,
794 const void *devPtr,
795 const struct cudaChannelFormatDesc *desc,
796 size_t width,
797 size_t height,
798 size_t pitch);
799
800extern __host__ cudaError_t CUDARTAPI
801cudaUnbindTexture(const struct textureReference *texref);
802
804 size_t *offset,
805 const struct textureReference *texref);
806
808 const struct textureReference **texref,
809 const void *symbol);
810
812 const struct surfaceReference **surfref,
813 const void *symbol);
814
815extern __host__ cudaError_t CUDARTAPI cudaDriverGetVersion(int *driverVersion);
816
818cudaRuntimeGetVersion(int *runtimeVersion);
819
820# undef __dv
821
822#endif /* cuda_runtime_api.h */
#define error(x)
Definition bigint.cpp:16
int __cudaDeviceCount
Definition call_kernel.h:27
unsigned int __cudaPeerIndex(int device, int peer)
Definition call_kernel.h:35
__thread int __cudaCurrentDevice
Definition call_kernel.h:29
Definition toml.hpp:1531
struct threadsList threadsList_t
threadsList_t * cudaThreadList
Definition cuda.h:27
int count
Definition cuda.h:51
cudaError_t lastError
Definition cuda_error.h:414
@ CUDA_ERROR_OUT_OF_MEMORY
The API call failed because it was unable to allocate enough memory to perform the requested operatio...
Definition cuda_error.h:26
@ CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED
This error indicates that a call to cuCtxEnablePeerAccess() is trying to re-enable peer access to a c...
Definition cuda_error.h:290
@ CUDA_ERROR_PEER_ACCESS_NOT_ENABLED
This error indicates that cuCtxDisablePeerAccess() is trying to disable peer access which has not bee...
Definition cuda_error.h:297
@ CUDA_ERROR_INVALID_VALUE
This indicates that one or more of the parameters passed to the API call is not within an acceptable ...
Definition cuda_error.h:20
@ cudaErrorInvalidDevice
This indicates that the device ordinal supplied by the user does not correspond to a valid CUDA devic...
Definition cuda_error.h:72
@ CUDA_SUCCESS
The API call returned with no errors.
Definition cuda_error.h:13
@ cudaSuccess
Definition cuda_error.h:14
enum cudaError cudaError_t
Definition cuda_error.h:412
__host__ cudaError_t CUDARTAPI cudaSetDoubleForHost(double *d)
__host__ cudaError_t CUDARTAPI cudaDeviceGetByPCIBusId(int *device, const char *pciBusId)
__host__ cudaError_t CUDARTAPI cudaBindTexture(size_t *offset, const struct textureReference *texref, const void *devPtr, const struct cudaChannelFormatDesc *desc, size_t size __dv(UINT_MAX))
__host__ cudaError_t CUDARTAPI cudaThreadExit(void)
const char * cudaGetErrorString(cudaError_t error)
Definition cuda_runtime_api.h:89
__host__ cudaError_t CUDARTAPI cudaMemset3D(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent)
__host__ cudaError_t CUDARTAPI cudaGetTextureAlignmentOffset(size_t *offset, const struct textureReference *texref)
cudaError_t cudaDeviceGetSharedMemConfig(int device)
Definition cuda_runtime_api.h:555
__host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority)
cudaError_t cudaDeviceGetLimit(int device)
Definition cuda_runtime_api.h:543
int cudaDeviceStart(int device)
Definition cuda_runtime_api.h:384
__host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaGetDevice(int *device)
__host__ cudaError_t CUDARTAPI cudaLaunch(const void *func)
__host__ cudaError_t CUDARTAPI cudaDeviceGetPCIBusId(char *pciBusId, int len, int device)
cudaError_t cudaMemcpy(T1 dst, T2 src, size_t count, enum cudaMemcpyKind kind)
Definition cuda_runtime_api.h:51
__host__ cudaError_t CUDARTAPI cudaMalloc3D(struct cudaPitchedPtr *pitchedDevPtr, struct cudaExtent extent)
__host__ cudaError_t CUDARTAPI cudaDriverGetVersion(int *driverVersion)
__host__ cudaError_t CUDARTAPI cudaMemcpy3DPeer(const struct cudaMemcpy3DPeerParms *p)
cudaError_t cudaDeviceReset()
Definition cuda_runtime_api.h:423
int cudaDeviceActive(int device)
Definition cuda_runtime_api.h:362
void cudaDeviceInsert(int device)
Definition cuda_runtime_api.h:289
void __syncthreads()
Definition cuda_runtime_api.h:567
cudaError_t cudaMemcpyFromSymbol(void *dst, const void *symbol, size_t count, size_t offset __dv(0), enum cudaMemcpyKind kind __dv(cudaMemcpyDeviceToHost))
Definition cuda_runtime_api.h:461
cudaError_t cudaGetLastError()
Definition cuda_runtime_api.h:505
__host__ cudaError_t CUDARTAPI cudaGetTextureReference(const struct textureReference **texref, const void *symbol)
__host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaGetDeviceProperties(struct cudaDeviceProp *prop, int device)
Definition cuda_runtime_api.h:484
__host__ cudaError_t CUDARTAPI cudaMemcpy3D(const struct cudaMemcpy3DParms *p)
__host__ cudaError_t CUDARTAPI cudaGetSurfaceReference(const struct surfaceReference **surfref, const void *symbol)
cudaError_t cudaGetDeviceCount(int *count)
Definition cuda_runtime_api.h:414
__host__ cudaError_t CUDARTAPI cudaBindTexture2D(size_t *offset, const struct textureReference *texref, const void *devPtr, const struct cudaChannelFormatDesc *desc, size_t width, size_t height, size_t pitch)
__host__ __cudart_builtin__ const char *CUDARTAPI cudaGetErrorName(cudaError_t error)
__host__ cudaError_t CUDARTAPI cudaMemset(void *devPtr, int value, size_t count)
__host__ cudaError_t CUDARTAPI cudaMemcpyPeer(void *dst, int dstDevice, const void *src, int srcDevice, size_t count)
__host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaRuntimeGetVersion(int *runtimeVersion)
cudaError_t cudaSetDevice(int device)
Definition cuda_runtime_api.h:401
__host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaEventCreateWithFlags(cudaEvent_t *event, unsigned int flags)
__host__ cudaError_t CUDARTAPI cudaUnbindTexture(const struct textureReference *texref)
__host__ cudaError_t CUDARTAPI cudaHostAlloc(void **pHost, size_t size, unsigned int flags)
__host__ cudaError_t CUDARTAPI cudaIpcCloseMemHandle(void *devPtr)
__host__ cudaError_t CUDARTAPI cudaSetValidDevices(int *device_arr, int len)
__host__ cudaError_t CUDARTAPI cudaMallocHost(void **ptr, size_t size)
__host__ cudaError_t CUDARTAPI cudaEventSynchronize(cudaEvent_t event)
void __threadfence()
Definition cuda_runtime_api.h:571
cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags)
Definition cuda_runtime_api.h:735
__host__ cudaError_t CUDARTAPI cudaSetupArgument(const void *arg, size_t size, size_t offset)
__host__ cudaError_t CUDARTAPI cudaHostUnregister(void *ptr)
struct cudaDevicesList cudaDeviceList_t
Structure that represents the devices of CUDA.
cudaError_t cudaThreadSynchronize()
Definition cuda_runtime_api.h:518
__host__ cudaError_t CUDARTAPI cudaChooseDevice(int *device, const struct cudaDeviceProp *prop)
__host__ cudaError_t CUDARTAPI cudaGetSymbolSize(size_t *size, const void *symbol)
void cudaPrintDevice()
Definition cuda_runtime_api.h:328
cudaError_t cudaDeviceDisablePeerAccess(int peerDevice)
Definition cuda_runtime_api.h:766
__host__ cudaError_t CUDARTAPI cudaSetDeviceFlags(unsigned int flags)
__host__ cudaError_t CUDARTAPI cudaHostRegister(void *ptr, size_t size, unsigned int flags)
cudaError_t cudaFree(void *devPtr)
Definition cuda_runtime_api.h:80
__host__ cudaError_t CUDARTAPI cudaMemset2D(void *devPtr, size_t pitch, int value, size_t width, size_t height)
__host__ cudaError_t CUDARTAPI cudaFreeHost(void *ptr)
cudaError_t __cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind)
impl_private
Definition cuda_runtime_api.h:33
__host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaDeviceSynchronize(void)
__host__ cudaError_t CUDARTAPI cudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end)
cudaError_t cudaDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice)
Definition cuda_runtime_api.h:720
__host__ cudaError_t CUDARTAPI cudaEventQuery(cudaEvent_t event)
__host__ cudaError_t CUDARTAPI cudaHostGetDevicePointer(void **pDevice, void *pHost, unsigned int flags)
__host__ cudaError_t CUDARTAPI cudaHostGetFlags(unsigned int *pFlags, void *pHost)
cudaError_t cudaMalloc(void **devPtr, size_t size)
Definition cuda_runtime_api.h:56
cudaError_t cudaMemcpyToSymbol(const void *symbol, const void *src, size_t count, size_t offset __dv(0), enum cudaMemcpyKind kind __dv(cudaMemcpyHostToDevice))
Definition cuda_runtime_api.h:444
__host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaMallocManaged(void **devPtr, size_t size, unsigned int flags)
__host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaEventDestroy(cudaEvent_t event)
__host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaFuncGetAttributes(struct cudaFuncAttributes *attr, const void *func)
__host__ cudaError_t CUDARTAPI cudaMemGetInfo(size_t *free, size_t *total)
cudaDeviceList_t * cudaDeviceList
Definition cuda_runtime_api.h:286
__host__ cudaError_t CUDARTAPI cudaGetSymbolAddress(void **devPtr, const void *symbol)
__device__ __cudart_builtin__ cudaError_t CUDARTAPI cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device)
Definition cuda_runtime_api.h:537
__host__ cudaError_t CUDARTAPI cudaMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind)
int searchCudaDevice(int device)
Definition cuda_runtime_api.h:343
__host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaPeekAtLastError(void)
__host__ cudaError_t CUDARTAPI cudaSetDoubleForDevice(double *d)
cudaError_t cudaDeviceGetCacheConfig(int device)
Definition cuda_runtime_api.h:549
__host__ cudaError_t CUDARTAPI cudaEventCreate(cudaEvent_t *event)
__host__ cudaError_t CUDARTAPI cudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height)
__host__ cudaError_t CUDARTAPI cudaPointerGetAttributes(struct cudaPointerAttributes *attributes, const void *ptr)
cudaMemcpyDeviceToHost
Device -> Host.
Definition driver_types.h:26
enum __device_builtin__ cudaDeviceAttr
Definition driver_types.h:127
cudaMemcpyHostToDevice
Host -> Device.
Definition driver_types.h:25
enum __device_builtin__ cudaMemcpyKind
Definition driver_types.h:23
__device_builtin__ struct CUevent_st * cudaEvent_t
Definition driver_types.h:38
#define __host__
Definition host_defines.h:112
#define __cudart_builtin__
Definition host_defines.h:123
#define __device__
Definition host_defines.h:113
#define UINT_MAX
Definition limits.h:32
#define NULL
Definition pthread.h:32
unsigned long int pthread_t
Definition pthread.h:41
int pthread_join(pthread_t __th, void **__thread_return)
void * malloc(size_t size)
void free(void *p)
Definition driver_types.h:41
Structure that represents the devices of CUDA.
Definition cuda_runtime_api.h:279
int active
Definition cuda_runtime_api.h:281
struct cudaDevicesList * prox
Definition cuda_runtime_api.h:283
struct cudaDeviceProp deviceProp
Definition cuda_runtime_api.h:282
int id
Definition cuda_runtime_api.h:280
Definition cuda.h:22
pthread_t thread
Definition cuda.h:23
struct threadsList * prox
Definition cuda.h:24
_Bool nondet_bool(void)