context.h (2014-04-30 15:38:09 -0400, (build fd32605))
Go to the documentation of this file.
1 // Copyright (c) AccelerEyes LLC. All rights reserved. //
2 // See http://www.accelereyes.com/eula for details. //
3 // This software is distributed WITHOUT ANY WARRANTY; without even //
4 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
5 // PURPOSE. See the above copyright notices for more information. //
6 //-----------------------------------------------------------------------//
7 
8 #pragma once
9 
10 #include "defines.h"
11 
12 #undef TRUE
13 #ifdef __cplusplus
14  #define TRUE =true
15  #define FLOP ='f'
16 #else
17  #define TRUE
18  #define FLOP
19 #endif
20 
21 #ifdef __cplusplus
22 namespace af {
24 
38  AFAPI void info(bool isdebug=false);
39 
75  AFAPI void deviceprop(char* d_name, char* d_platform, char *d_toolkit, char* d_compute);
76 
83  AFAPI void deviceset(int index);
84 
89  AFAPI int deviceget();
90 
95  AFAPI int devicecount();
97 
98 
99 } // namespace af
100 #endif // __cplusplus
101 
102 
104 
107 
108  AFAPI afError af_deviceprop(char* d_name, char* d_platform, char *d_toolkit, char* d_compute);
109 
110  AFAPI afError af_cuda_info(char *driverVersion, double *runtimeVersion, int buflen);
111 
123 AFAPI afError af_deviceset(int index, bool use_graphics TRUE, char sort_mode FLOP);
124 
129 AFAPI afError af_deviceget(int *dev);
130 
136 AFAPI afError af_devicegetreal(int dev, int *devreal);
137 
143 AFAPI afError af_devicepush(int index);
144 
150 
156 
157 
159 
160 #undef TRUE
void info(bool isdebug=false)
Print diagnostic information on driver, runtime, memory, and devices.
void deviceprop(char *d_name, char *d_platform, char *d_toolkit, char *d_compute)
Returns information about current device and platform.
#define FLOP
Definition: context.h:15
afError af_cuda_info(char *driverVersion, double *runtimeVersion, int buflen)
afError af_devicepop()
Pop last device off stack and switch to it.
afError
Definition: defines.h:10
#define TRUE
Definition: context.h:14
afError af_deviceprop(char *d_name, char *d_platform, char *d_toolkit, char *d_compute)
afError af_info()
Print diagnostic information on driver, runtime, memory, and devices.
int devicecount()
Returns the number of available devices.
afError af_deviceset(int index, bool use_graphics=true, char sort_mode='f')
Switch to specified device.
void deviceset(int index)
Switch to specified device.
afError af_devicegetreal(int dev, int *devreal)
Translate sorted device index into real CUDA device index.
#define AFAPI
Definition: defines.h:45
afError af_devicecount(int *count)
int deviceget()
Return the index of current device.
afError af_deviceget(int *dev)
Fetch current device index (sorted by estimated FLOPs).
afError af_devicepush(int index)
Save current device on stack and switch to specified device.
unsigned count(const array &input)
Count nonzero elements in input.