uygn / aparapi

Automatically exported from code.google.com/p/aparapi
Other
0 stars 0 forks source link

Aparapi incorrectly tries to maintain backward compatibility with older non-Device code #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is an issue in the Trunk code which we discussed offline.

KernelRunner.java
Line 1365

if ((kernel.getExecutionMode().isOpenCL() && device == null) || (device 
instanceof OpenCLDevice))

Test will incorrectly pass if JTP mode is manually selected, but a Device is 
also supplied. The result is the following:

KernelRunner.java
Line 1637

if (explicit && ((kernel.getExecutionMode() == Kernel.EXECUTION_MODE.GPU) || 
(kernel.getExecutionMode() == Kernel.EXECUTION_MODE.CPU))) {

Test will fail to retrieve correct results from execution performed above.

I have worked through a number of patches for this, but I believe that the 
patch supplied will be the most non-intrusive.

Original issue reported on code.google.com by ryan.lam...@gmail.com on 3 Nov 2012 at 12:54

GoogleCodeExporter commented 9 years ago
I think the trunk revision number is entertaining, if not appropriate :)

Original comment by ryan.lam...@gmail.com on 3 Nov 2012 at 12:56

Attachments:

GoogleCodeExporter commented 9 years ago
The patch, in short:

/* for backward compatibility reasons we still honor execution mode, but only 
if the Range *does not* contain a device specification */
      Device device = _range.getDevice();
      if ((kernel.getExecutionMode().isOpenCL() && device == null) || (device instanceof OpenCLDevice))

becomes

// See if user supplied a Device
Device device = _range.getDevice();

  /* for backward compatibility reasons we still honor execution mode */
  if (kernel.getExecutionMode().isOpenCL()) {

     if ((device == null) || (device instanceof OpenCLDevice)) {

Original comment by ryan.lam...@gmail.com on 3 Nov 2012 at 12:58

GoogleCodeExporter commented 9 years ago
It appears this patch did not make it into the latest Aparapi release? I am 
seeing the same behavior as the previous codebase and I do not see the patch 
applied to the trunk.

If that is true, I will have to apply the patch this week.

Original comment by ryan.lam...@gmail.com on 19 Nov 2012 at 6:35

GoogleCodeExporter commented 9 years ago
The patch has been applied to the trunk

Original comment by ryan.lam...@gmail.com on 19 Nov 2012 at 8:11