Skip to content

Commit 14cb452

Browse files
authored
Added documentation for cuda_wrappers (#18)
1 parent 41e527e commit 14cb452

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

adaboost/utils/cuda_wrappers.hpp

+35
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,52 @@ namespace adaboost
1313
enum direction {HostToDevice, DeviceToHost};
1414
typedef cudaEvent_t cuda_event_t;
1515

16+
/*
17+
* Used for allocating memory on the device.
18+
*
19+
* @param ptr Pointer to allocated device memory
20+
* @param num_bytes Requested allocation size in bytes
21+
* allocates num_bytes of linear memory on the device
22+
*/
1623
void cuda_malloc(void** ptr, unsigned num_bytes);
1724

25+
/*
26+
* Used for copying data between host and device.
27+
*
28+
* @param ptr_1 Destination memory address
29+
* @param ptr_2 Source memory address
30+
* @param num_bytes Size in bytes to copy
31+
* @param d Determines the direction of copying data
32+
*/
1833
void cuda_memcpy
1934
(void* ptr_1, void* ptr_2, unsigned num_bytes, direction d);
2035

36+
/*
37+
* Used for creating an event object for the current device.
38+
*
39+
* @param event_ptr Newly created event
40+
*/
2141
void cuda_event_create(cuda_event_t* event_ptr);
2242

43+
/*
44+
* Used for recording an event.
45+
*
46+
* @param event Event to record
47+
*/
2348
void cuda_event_record(cuda_event_t event);
2449

50+
/*
51+
* Used for waiting for an event to complete.
52+
*
53+
* @param event Event to wait for
54+
*/
2555
void cuda_event_synchronize(cuda_event_t event);
2656

57+
/*
58+
* Used for freeing memory on the device.
59+
*
60+
* @param ptr Device pointer to memory to free
61+
*/
2762
void cuda_free(void* ptr);
2863

2964
} // namspace cuda

0 commit comments

Comments
 (0)