@@ -22,56 +22,56 @@ extern "C" {
22
22
23
23
typedef struct {
24
24
// open the device and connect to it
25
- int (* dev_open )(vx_device_h * hdevice );
25
+ int (* dev_open ) (vx_device_h * hdevice );
26
26
27
27
// Close the device when all the operations are done
28
- int (* dev_close )(vx_device_h hdevice );
28
+ int (* dev_close ) (vx_device_h hdevice );
29
29
30
30
// return device configurations
31
- int (* dev_caps )(vx_device_h hdevice , uint32_t caps_id , uint64_t * value );
31
+ int (* dev_caps ) (vx_device_h hdevice , uint32_t caps_id , uint64_t * value );
32
32
33
33
// allocate device memory and return address
34
- int (* mem_alloc )(vx_device_h hdevice , uint64_t size , int flags , vx_buffer_h * hbuffer );
34
+ int (* mem_alloc ) (vx_device_h hdevice , uint64_t size , int flags , vx_buffer_h * hbuffer );
35
35
36
36
// reserve memory address range
37
- int (* mem_reserve )(vx_device_h hdevice , uint64_t address , uint64_t size , int flags , vx_buffer_h * hbuffer );
37
+ int (* mem_reserve ) (vx_device_h hdevice , uint64_t address , uint64_t size , int flags , vx_buffer_h * hbuffer );
38
38
39
39
// release device memory
40
- int (* mem_free )(vx_buffer_h hbuffer );
40
+ int (* mem_free ) (vx_buffer_h hbuffer );
41
41
42
42
// set device memory access rights
43
- int (* mem_access )(vx_buffer_h hbuffer , uint64_t offset , uint64_t size , int flags );
43
+ int (* mem_access ) (vx_buffer_h hbuffer , uint64_t offset , uint64_t size , int flags );
44
44
45
45
// return device memory address
46
- int (* mem_address )(vx_buffer_h hbuffer , uint64_t * address );
46
+ int (* mem_address ) (vx_buffer_h hbuffer , uint64_t * address );
47
47
48
48
// get device memory info
49
- int (* mem_info )(vx_device_h hdevice , uint64_t * mem_free , uint64_t * mem_used );
49
+ int (* mem_info ) (vx_device_h hdevice , uint64_t * mem_free , uint64_t * mem_used );
50
50
51
51
// Copy bytes from host to device memory
52
- int (* copy_to_dev )(vx_buffer_h hbuffer , const void * host_ptr , uint64_t dst_offset , uint64_t size );
52
+ int (* copy_to_dev ) (vx_buffer_h hbuffer , const void * host_ptr , uint64_t dst_offset , uint64_t size );
53
53
54
54
// Copy bytes from device memory to host
55
- int (* copy_from_dev )(void * host_ptr , vx_buffer_h hbuffer , uint64_t src_offset , uint64_t size );
55
+ int (* copy_from_dev ) (void * host_ptr , vx_buffer_h hbuffer , uint64_t src_offset , uint64_t size );
56
56
57
57
// Start device execution
58
- int (* start )(vx_device_h hdevice , vx_buffer_h hkernel , vx_buffer_h harguments );
58
+ int (* start ) (vx_device_h hdevice , vx_buffer_h hkernel , vx_buffer_h harguments );
59
59
60
60
// Wait for device ready with milliseconds timeout
61
- int (* ready_wait )(vx_device_h hdevice , uint64_t timeout );
61
+ int (* ready_wait ) (vx_device_h hdevice , uint64_t timeout );
62
62
63
63
// read device configuration registers
64
- int (* dcr_read )(vx_device_h hdevice , uint32_t addr , uint32_t * value );
64
+ int (* dcr_read ) (vx_device_h hdevice , uint32_t addr , uint32_t * value );
65
65
66
66
// write device configuration registers
67
- int (* dcr_write )(vx_device_h hdevice , uint32_t addr , uint32_t value );
67
+ int (* dcr_write ) (vx_device_h hdevice , uint32_t addr , uint32_t value );
68
68
69
69
// query device performance counter
70
- int (* mpm_query )(vx_device_h hdevice , uint32_t addr , uint32_t core_id , uint64_t * value );
70
+ int (* mpm_query ) (vx_device_h hdevice , uint32_t addr , uint32_t core_id , uint64_t * value );
71
71
72
72
} callbacks_t ;
73
73
74
- int vx_dev_init (callbacks_t * callbacks );
74
+ int vx_dev_init (callbacks_t * callbacks );
75
75
76
76
#ifdef __cplusplus
77
77
}
0 commit comments