mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-06-28 09:37:38 -04:00
extending divergence test coverage
This commit is contained in:
parent
5dbfcecc21
commit
aaeb7ba644
4 changed files with 47 additions and 0 deletions
|
@ -12,6 +12,8 @@
|
|||
// limitations under the License.
|
||||
|
||||
#include "util.h"
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
|
||||
// return file extension
|
||||
|
@ -36,4 +38,21 @@ void aligned_free(void *ptr) {
|
|||
// retreive the stored unaligned address and use it to free the allocation
|
||||
void* unaligned_addr = ((void**)ptr)[-1];
|
||||
free(unaligned_addr);
|
||||
}
|
||||
|
||||
std::string vortex::resolve_file_path(const std::string& filename, const std::string& searchPaths) {
|
||||
std::ifstream ifs(filename);
|
||||
if (!ifs) {
|
||||
std::stringstream ss(searchPaths);
|
||||
std::string path;
|
||||
while (std::getline(ss, path, ',')) {
|
||||
if (!path.empty()) {
|
||||
std::string filePath = path + "/" + filename;
|
||||
std::ifstream ifs(filePath);
|
||||
if (ifs)
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
return filename;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue