SWDEV-336378 - cmake support for vulkan example (#2725)

Change-Id: I5ac28d2f57c1732e243674aa904cabe23be34797
This commit is contained in:
ROCm CI Service Account
2022-06-13 15:35:33 +05:30
committed by GitHub
parent ab6fc6dfde
commit ab1b5f9d37
4 changed files with 264 additions and 3 deletions
+14 -2
View File
@@ -37,7 +37,7 @@
#include <chrono>
#include <algorithm>
#include "linmath.h"
#include "hip_runtime.h"
#include "hip/hip_runtime.h"
#include "SineWaveSimulation.h"
@@ -50,6 +50,18 @@ std::string execution_path;
#define ENABLE_VALIDATION (true)
#endif
#ifndef _WIN64
#define MAX_PATH 260
int GetModuleFileName(void* hndl, char* name, int size)
{
FILE* stream = fopen("/proc/self/cmdline", "r");
fgets(name, size, stream);
fclose(stream);
return strlen(name);
}
#endif
class VulkanCudaSineWave : public VulkanBaseApp
{
@@ -93,7 +105,7 @@ public:
throw std::runtime_error("Requested height and width is too large for this sample!");
}
// Add our compiled vulkan shader files
TCHAR buffer[MAX_PATH] = { 0 };
char buffer[MAX_PATH] = { 0 }; //assuming none unicode
GetModuleFileName(NULL, buffer, MAX_PATH);
std::string str3 = std::string(buffer);
std::string str1 = "vert.spv" ; //sdkFindFilePath("sinewave.vert", execution_path.c_str());