@@ -13,17 +13,52 @@ namespace adaboost
13
13
enum direction {HostToDevice, DeviceToHost};
14
14
typedef cudaEvent_t cuda_event_t ;
15
15
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
+ */
16
23
void cuda_malloc (void ** ptr, unsigned num_bytes);
17
24
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
+ */
18
33
void cuda_memcpy
19
34
(void * ptr_1, void * ptr_2, unsigned num_bytes, direction d);
20
35
36
+ /*
37
+ * Used for creating an event object for the current device.
38
+ *
39
+ * @param event_ptr Newly created event
40
+ */
21
41
void cuda_event_create (cuda_event_t * event_ptr);
22
42
43
+ /*
44
+ * Used for recording an event.
45
+ *
46
+ * @param event Event to record
47
+ */
23
48
void cuda_event_record (cuda_event_t event);
24
49
50
+ /*
51
+ * Used for waiting for an event to complete.
52
+ *
53
+ * @param event Event to wait for
54
+ */
25
55
void cuda_event_synchronize (cuda_event_t event);
26
56
57
+ /*
58
+ * Used for freeing memory on the device.
59
+ *
60
+ * @param ptr Device pointer to memory to free
61
+ */
27
62
void cuda_free (void * ptr);
28
63
29
64
} // namspace cuda
0 commit comments