Skip to content

Commit

Permalink
Build program per device. Otherwise qualcomm platform fails to
Browse files Browse the repository at this point in the history
compile for 2 devices at 1 shot!
  • Loading branch information
krrishnarraj committed Jul 6, 2014
1 parent 9ec5c0e commit b3ddfdb
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 21 deletions.
24 changes: 15 additions & 9 deletions src/clpeak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,6 @@ int clPeak::runAll()
isComputeInt = false;
}

try {
prog.build(devices, BUILD_OPTIONS);
}
catch (cl::Error error)
{
log->print(TAB "Build Log: " + prog.getBuildInfo<CL_PROGRAM_BUILD_LOG>(devices[0]) + NEWLINE NEWLINE);
}

for(int d=0; d < (int)devices.size(); d++)
{
if(forceDevice && (d != specifiedDevice))
Expand All @@ -114,6 +106,17 @@ int clPeak::runAll()
log->xmlAppendAttribs("name", devInfo.deviceName);
log->xmlAppendAttribs("driver_version", devInfo.driverVersion);

try {
vector<cl::Device> dev = {devices[d]};
prog.build(dev, BUILD_OPTIONS);
}
catch (cl::Error error)
{
log->print(TAB TAB "Build Log: " + prog.getBuildInfo<CL_PROGRAM_BUILD_LOG>(devices[d])
+ NEWLINE NEWLINE);
continue;
}

cl::CommandQueue queue = cl::CommandQueue(ctx, devices[d], CL_QUEUE_PROFILING_ENABLE);

runGlobalBandwidthTest(queue, prog, devInfo);
Expand All @@ -132,7 +135,10 @@ int clPeak::runAll()
}
catch(cl::Error error)
{
log->print(error.err() + NEWLINE);
stringstream ss;
ss << error.what() << " (" << error.err() << ")" NEWLINE;

log->print(ss.str());
return -1;
}

Expand Down
6 changes: 4 additions & 2 deletions src/compute_dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ int clPeak::runComputeDP(cl::CommandQueue &queue, cl::Program &prog, device_info
}
catch(cl::Error error)
{
log->print(error.err() + NEWLINE);
log->print(TAB TAB TAB "Tests skipped" NEWLINE);
stringstream ss;
ss << error.what() << " (" << error.err() << ")" NEWLINE
<< TAB TAB TAB "Tests skipped" NEWLINE;
log->print(ss.str());
return -1;
}

Expand Down
6 changes: 4 additions & 2 deletions src/compute_integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ int clPeak::runComputeInteger(cl::CommandQueue &queue, cl::Program &prog, device
}
catch(cl::Error error)
{
log->print(error.err() + NEWLINE);
log->print(TAB TAB TAB "Tests skipped" NEWLINE);
stringstream ss;
ss << error.what() << " (" << error.err() << ")" NEWLINE
<< TAB TAB TAB "Tests skipped" NEWLINE;
log->print(ss.str());
return -1;
}

Expand Down
6 changes: 4 additions & 2 deletions src/compute_sp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ int clPeak::runComputeSP(cl::CommandQueue &queue, cl::Program &prog, device_info
}
catch(cl::Error error)
{
log->print(error.err() + NEWLINE);
log->print(TAB TAB TAB "Tests skipped" NEWLINE);
stringstream ss;
ss << error.what() << " (" << error.err() << ")" NEWLINE
<< TAB TAB TAB "Tests skipped" NEWLINE;
log->print(ss.str());
return -1;
}

Expand Down
6 changes: 4 additions & 2 deletions src/global_bandwidth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ int clPeak::runGlobalBandwidthTest(cl::CommandQueue &queue, cl::Program &prog, d
}
catch(cl::Error error)
{
log->print(error.err() + NEWLINE);
log->print(TAB TAB TAB "Tests skipped" NEWLINE);
stringstream ss;
ss << error.what() << " (" << error.err() << ")" NEWLINE
<< TAB TAB TAB "Tests skipped" NEWLINE;
log->print(ss.str());

if(arr) delete [] arr;
return -1;
Expand Down
1 change: 1 addition & 0 deletions src/include/clpeak.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <stdio.h>
#include <iomanip>
#include <string.h>
#include <sstream>
#include <common.h>
#include <logger.h>

Expand Down
6 changes: 4 additions & 2 deletions src/kernel_latency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ int clPeak::runKernelLatency(cl::CommandQueue &queue, cl::Program &prog, device_
}
catch(cl::Error error)
{
log->print(error.err() + NEWLINE);
log->print(TAB TAB "Tests skipped" NEWLINE);
stringstream ss;
ss << error.what() << " (" << error.err() << ")" NEWLINE
<< TAB TAB TAB "Tests skipped" NEWLINE;
log->print(ss.str());
return -1;
}

Expand Down
6 changes: 4 additions & 2 deletions src/transfer_bandwidth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ int clPeak::runTransferBandwidthTest(cl::CommandQueue &queue, cl::Program &prog,
}
catch(cl::Error error)
{
log->print(error.err() + NEWLINE);
log->print(TAB TAB TAB "Tests skipped" NEWLINE);
stringstream ss;
ss << error.what() << " (" << error.err() << ")" NEWLINE
<< TAB TAB TAB "Tests skipped" NEWLINE;
log->print(ss.str());

if(arr) delete [] arr;
return -1;
Expand Down

0 comments on commit b3ddfdb

Please sign in to comment.