MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / sdkFindFilePath

Function sdkFindFilePath

Common/helper_string.h:278–432  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////// Find the path for a file assuming that files are found in the searchPath. @return the path if succeeded, otherwise 0 @param filename name of the file @param executable_path optional absolute path of the executable /////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

276//! @param executable_path optional absolute path of the executable
277//////////////////////////////////////////////////////////////////////////////
278inline char *sdkFindFilePath(const char *filename,
279 const char *executable_path) {
280 // <executable_name> defines a variable that is replaced with the name of the
281 // executable
282
283 // Typical relative search paths to locate needed companion files (e.g. sample
284 // input data, or JIT source files) The origin for the relative search may be
285 // the .exe file, a .bat file launching an .exe, a browser .exe launching the
286 // .exe or .bat, etc
287 const char *searchPath[] = {
288 "./", // same dir
289 "./data/", // same dir
290
291 "../../../../cpp/<executable_name>/", // up 4 in tree
292 "../../../cpp/<executable_name>/", // up 3 in tree
293 "../../cpp/<executable_name>/", // up 2 in tree
294
295 "../../../../cpp/<executable_name>/data/", // up 4 in tree
296 "../../../cpp/<executable_name>/data/", // up 3 in tree
297 "../../cpp/<executable_name>/data/", // up 2 in tree
298
299 "../../../../cpp/0_Introduction/<executable_name>/", // up 4 in tree
300 "../../../cpp/0_Introduction/<executable_name>/", // up 3 in tree
301 "../../cpp/0_Introduction/<executable_name>/", // up 2 in tree
302
303 "../../../../cpp/1_Utilities/<executable_name>/", // up 4 in tree
304 "../../../cpp/1_Utilities/<executable_name>/", // up 3 in tree
305 "../../cpp/1_Utilities/<executable_name>/", // up 2 in tree
306
307 "../../../../cpp/2_Concepts_and_Techniques/<executable_name>/", // up 4 in tree
308 "../../../cpp/2_Concepts_and_Techniques/<executable_name>/", // up 3 in tree
309 "../../cpp/2_Concepts_and_Techniques/<executable_name>/", // up 2 in tree
310
311 "../../../../cpp/3_CUDA_Features/<executable_name>/", // up 4 in tree
312 "../../../cpp/3_CUDA_Features/<executable_name>/", // up 3 in tree
313 "../../cpp/3_CUDA_Features/<executable_name>/", // up 2 in tree
314
315 "../../../../cpp/4_CUDA_Libraries/<executable_name>/", // up 4 in tree
316 "../../../cpp/4_CUDA_Libraries/<executable_name>/", // up 3 in tree
317 "../../cpp/4_CUDA_Libraries/<executable_name>/", // up 2 in tree
318
319 "../../../../cpp/5_Domain_Specific/<executable_name>/", // up 4 in tree
320 "../../../cpp/5_Domain_Specific/<executable_name>/", // up 3 in tree
321 "../../cpp/5_Domain_Specific/<executable_name>/", // up 2 in tree
322
323 "../../../../cpp/6_Performance/<executable_name>/", // up 4 in tree
324 "../../../cpp/6_Performance/<executable_name>/", // up 3 in tree
325 "../../cpp/6_Performance/<executable_name>/", // up 2 in tree
326
327 "../../../../cpp/0_Introduction/<executable_name>/data/", // up 4 in tree
328 "../../../cpp/0_Introduction/<executable_name>/data/", // up 3 in tree
329 "../../cpp/0_Introduction/<executable_name>/data/", // up 2 in tree
330
331 "../../../../cpp/1_Utilities/<executable_name>/data/", // up 4 in tree
332 "../../../cpp/1_Utilities/<executable_name>/data/", // up 3 in tree
333 "../../cpp/1_Utilities/<executable_name>/data/", // up 2 in tree
334
335 "../../../../cpp/2_Concepts_and_Techniques/<executable_name>/data/", // up 4 in tree

Callers 15

runSingleTestFunction · 0.85
loadImageDataFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
runAutoTestFunction · 0.85
mainFunction · 0.85
loadDefaultImageFunction · 0.85
runAutoTestFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
loadImageDataFunction · 0.85

Calls 2

stringClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected