Skip to content

[Bounty $30] Private superclass fields missing from struct This_s #15

Open
@freemo

Description

@freemo

From @Pr0methean on July 6, 2016 2:19

When I create the following classes:

abstract class OperatorKernel extends Kernel {
  private float[] output;
  public void init(int pixels) {
    if (output == null) {
      output = new float[pixels];
    }
  }
}

class ProductKernel extends OperatorKernel {/*...*/}

and then call init() on a ProductKernel, I get this error:

Jul 05, 2016 7:11:43 PM com.amd.aparapi.internal.kernel.KernelRunner warnFallBackAndExecute
WARNING: Reverting to Java Thread Pool (JTP) for class com.google.users.polymorpheus.experimental.arttree.operators.X$XK
ernel: OpenCL compile failed
clBuildProgram failed
************************************************
<kernel>:36:13: error: no member named 'output' in 'struct This_s'
      this->output[pixelId]  = com_google_users_polymorpheus_experimental_arttree_operators_UnaryOperatorKernel__calcula
tePixelById(this, pixelId) * (float)this->signum;
      ~~~~  ^
<kernel>:36:163: error: no member named 'signum' in 'struct This_s'
      this->output[pixelId]  = com_google_users_polymorpheus_experimental_arttree_operators_UnaryOperatorKernel__calcula
tePixelById(this, pixelId) * (float)this->signum;

                                    ~~~~  ^

************************************************

Changing the visibility of the inherited fields to protected seems to fix this. I suspect the problem is that the bytecode-to-OpenCL compiler isn't looking at the superclass bytecode, even when the superclass isn't immediately Kernel.

Copied from original issue: aparapi/aparapi#31

Metadata

Metadata

Assignees

No one assigned

    Labels

    bounty $$$Cash reward!bugFix something that is broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions