Commit a1e16f52 authored by Kazutomo Yoshii's avatar Kazutomo Yoshii
Browse files

fix for FPGA

parent bd9cb0d4
......@@ -56,9 +56,11 @@ private:
vector<struct arg_struct> kargs;
public:
char *loadfile(string fn)
char *loadfile(string fn, cl_ulong &sz)
{
struct stat st;
sz = 0;
stat(fn.c_str(), &st);
......@@ -75,7 +77,7 @@ public:
return NULL;
}
f0.seekg(0, f0.end);
cl_ulong sz = f0.tellg();
sz = f0.tellg();
f0.seekg(0, f0.beg);
......@@ -87,11 +89,12 @@ public:
#ifdef ENABLE_INTELFPGA
bool loadprog(string fn) {
char *binfile = loadfile(fn);
cl_ulong sz;
char *binfile = loadfile(fn, sz);
if (! binfile)
return false;
cl::Program::Binaries bin;
bin.push_back({binfile,strlen(binfile)});
bin.push_back({binfile,sz});
prgs.push_back(cl::Program(ctx,devs,bin));
return true;
}
......
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