Skip to content

Commit

Permalink
Remove AMD workaround, as it seems to be solved
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed Apr 5, 2015
1 parent cc19830 commit f6058d0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
27 changes: 1 addition & 26 deletions tests/context_setup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,9 @@ struct ContextSetup {
};

struct ContextReference {
ContextReference() :
ctx( vex::current_context() )
{
#ifdef VEXCL_BACKEND_OPENCL
amd_is_present = std::any_of(ctx.queue().begin(), ctx.queue().end(),
[](const cl::CommandQueue &q) {
return vex::Filter::Platform("AMD")(q.getInfo<CL_QUEUE_DEVICE>());
});
#else
amd_is_present = false;
#endif
}

void amd_workaround() const {
#ifdef VEXCL_BACKEND_OPENCL
// There is a bug in AMD OpenCL that requires to call finish() on
// command queues after some kernels launch:
// http://devgurus.amd.com/message/1295503#1295503
if (amd_is_present) {
std::for_each(ctx.queue().begin(), ctx.queue().end(), [](const cl::CommandQueue &q) {
q.finish();
});
}
#endif
}
ContextReference() : ctx( vex::current_context() ) { }

const vex::Context &ctx;
bool amd_is_present;
};

#define SAMPLE_SIZE 32
Expand Down
3 changes: 0 additions & 3 deletions tests/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ BOOST_AUTO_TEST_CASE(function_generator)

for(int i = 0; i < 100; i++) {
X = rk2(X);
amd_workaround();
}

check_sample(X, [&](size_t idx, double a) {
Expand Down Expand Up @@ -149,7 +148,6 @@ BOOST_AUTO_TEST_CASE(function_adapter)

for(int i = 0; i < 100; i++) {
X = rk2(X);
amd_workaround();
}

check_sample(X, [&](size_t idx, double a) {
Expand Down Expand Up @@ -208,7 +206,6 @@ BOOST_AUTO_TEST_CASE(lazy_evaluation)

for(int i = 0; i < 100; i++) {
rk2(X, dt);
amd_workaround();
}

check_sample(X, [&](size_t idx, double a) {
Expand Down

0 comments on commit f6058d0

Please sign in to comment.