Commit 98f2aee3 authored by Kazutomo Yoshii's avatar Kazutomo Yoshii
Browse files

add a kernel file check

parent ea7487db
......@@ -8,6 +8,7 @@
//
// See COPYRIGHT for licensing
#include <sys/stat.h>
#include <iostream>
#include <fstream>
#include <CL/cl.hpp>
......@@ -54,7 +55,14 @@ private:
public:
bool buildprgsFromBinary(string fn) {
struct stat st;
stat(fn.c_str(), &st);
if (!S_ISREG(st.st_mode)) {
cout << fn << " is not a regular file!" << endl;
return false;
}
// load binary and build prgs
ifstream f0(fn.c_str(), ifstream::binary);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment