MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / af_info_string

Function af_info_string

src/api/c/device.cpp:168–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168af_err af_info_string(char** str, const bool verbose) {
169 UNUSED(verbose); // TODO(umar): Add something useful
170 try {
171 std::string infoStr = getDeviceInfo();
172 void* halloc_ptr = nullptr;
173 af_alloc_host(&halloc_ptr, sizeof(char) * (infoStr.size() + 1));
174 memcpy(str, &halloc_ptr, sizeof(void*));
175
176 // Need to do a deep copy
177 // str.c_str wont cut it
178 infoStr.copy(*str, infoStr.size());
179 (*str)[infoStr.size()] = '\0';
180 }
181 CATCHALL;
182
183 return AF_SUCCESS;
184}
185
186af_err af_device_info(char* d_name, char* d_platform, char* d_toolkit,
187 char* d_compute) {

Callers 2

TESTFunction · 0.50
infoStringFunction · 0.50

Calls 3

af_alloc_hostFunction · 0.70
getDeviceInfoFunction · 0.50
copyMethod · 0.45

Tested by

no test coverage detected