Merge branch 'shawnz_bug_fix' into 'master'

Fixed new bug reported during CUDA 13.1 test: 5514725 and 5518076

See merge request cuda-samples/cuda-samples!133
This commit is contained in:
Rob Armstrong 2025-09-18 10:12:12 -07:00
commit 1165d53ddf
2 changed files with 15 additions and 5 deletions

View File

@ -52,12 +52,22 @@
#include <memory.h>
#include <sys/un.h>
#endif
#include <filesystem>
#include <vector>
// Simple filesystem compatibility for GCC 7.x
#if defined(__GNUC__) && __GNUC__ < 8
#include <cstdlib>
#include <string>
inline std::string getSocketFolder() {
const char* tmpdir = std::getenv("TMPDIR");
return tmpdir ? std::string(tmpdir) : "/tmp";
}
#else
#include <filesystem>
inline std::string getSocketFolder() {
return std::filesystem::temp_directory_path().string();
}
#endif
typedef struct sharedMemoryInfo_st {
void *addr;