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

Function af_get_kernel_cache_directory

src/api/c/device.cpp:383–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383af_err af_get_kernel_cache_directory(size_t* length, char* path) {
384 try {
385 std::string& cache_path = getCacheDirectory();
386 if (path == nullptr) {
387 ARG_ASSERT(length != nullptr, 1);
388 *length = cache_path.size();
389 } else {
390 size_t min_len = cache_path.size();
391 if (length) {
392 if (*length < cache_path.size()) {
393 AF_ERROR("Length not sufficient to store the path",
394 AF_ERR_SIZE);
395 }
396 min_len = std::min(*length, cache_path.size());
397 }
398 memcpy(path, cache_path.c_str(), min_len);
399 }
400 }
401 CATCHALL
402 return AF_SUCCESS;
403}
404
405af_err af_set_kernel_cache_directory(const char* path, int override_env) {
406 try {

Callers 1

TESTFunction · 0.50

Calls 1

minFunction · 0.50

Tested by

no test coverage detected