Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error JNAerating CLDGEMMKernels.cl: NullPointerException #34

Open
fossil opened this issue May 22, 2016 · 0 comments
Open

Error JNAerating CLDGEMMKernels.cl: NullPointerException #34

fossil opened this issue May 22, 2016 · 0 comments

Comments

@fossil
Copy link

fossil commented May 22, 2016

get NullPointerException, when tried to build the following code

define WIDTH 4

if WIDTH == 1

typedef float floatX;

elif WIDTH == 2

typedef float2 floatX;

elif WIDTH == 4

typedef float4 floatX;

endif

// Use wider data types
__kernel void gemm4(const int M, const int N, const int K,
const __global double* A,
const __global double* B,
__global double* C) {

// Thread identifiers
const int row = get_local_id(0); // Local row ID (max: TS/WIDTH)
const int col = get_local_id(1); // Local col ID (max: TS)
const int globalRow = (TS/WIDTH)*get_group_id(0) + row; // 0..M/WIDTH
const int globalCol = TS*get_group_id(1) + col; // 0..N

// Local memory to fit a tile of TS*TS elements of A and B
__local floatX Asub[TS][TS/WIDTH];
__local floatX Bsub[TS][TS/WIDTH];

// Initialize the accumulation registers
#if WIDTH == 1
    floatX acc = 0.0f;
#elif WIDTH == 2
    floatX acc = { 0.0f, 0.0f };
#elif WIDTH == 4
    floatX acc = { 0.0f, 0.0f, 0.0f, 0.0f };
#endif

// Loop over all tiles
const int numTiles = K/TS;

...
}

after replace with
int ts = TS;
const int numTiles = K/ts;

builds fine.

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.nativelibs4java:maven-javacl-plugin:1.0.0-RC4:compile (default) on project clqr: Error JNAerating CLDGEMMKernels.cl: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.nativelibs4java:maven-javacl-plugin:1.0.0-RC4:compile (default) on project clqr: Error JNAerating CLDGEMMKernels.cl
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error JNAerating CLDGEMMKernels.cl
at com.nativelibs4java.opencl.generator.JavaCLGeneratorMojo.generateAll(JavaCLGeneratorMojo.java:191)
at com.nativelibs4java.opencl.generator.JavaCLGeneratorMojo.execute(JavaCLGeneratorMojo.java:210)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.NullPointerException
at com.ochafik.lang.jnaerator.TypeConversion.convertExpressionToJava(TypeConversion.java:1223)
at com.ochafik.lang.jnaerator.BridJTypeConversion.convertExpressionToJava(BridJTypeConversion.java:488)
at com.ochafik.lang.jnaerator.DeclarationsConverter.convertConstant(DeclarationsConverter.java:206)
at com.ochafik.lang.jnaerator.DeclarationsConverter$1.visitVariablesDeclaration(DeclarationsConverter.java:176)
at com.ochafik.lang.jnaerator.parser.VariablesDeclaration.accept(VariablesDeclaration.java:41)
at com.ochafik.lang.jnaerator.parser.Scanner.visit(Scanner.java:479)
at com.ochafik.lang.jnaerator.parser.Scanner.visitBlock(Scanner.java:378)
at com.ochafik.lang.jnaerator.parser.Statement$Block.accept(Statement.java:379)
at com.ochafik.lang.jnaerator.parser.Scanner.visit(Scanner.java:468)
at com.ochafik.lang.jnaerator.parser.Scanner.visitFunction(Scanner.java:106)
at com.ochafik.lang.jnaerator.parser.Function.accept(Function.java:215)
at com.ochafik.lang.jnaerator.parser.Scanner.visit(Scanner.java:479)
at com.ochafik.lang.jnaerator.parser.Scanner.visitSourceFile(Scanner.java:235)
at com.ochafik.lang.jnaerator.parser.SourceFile.accept(SourceFile.java:101)
at com.ochafik.lang.jnaerator.SourceFiles.accept(SourceFiles.java:49)
at com.ochafik.lang.jnaerator.DeclarationsConverter.convertConstants(DeclarationsConverter.java:128)
at com.nativelibs4java.opencl.generator.JavaCLGenerator.generateLibraryFiles(JavaCLGenerator.java:470)
at com.ochafik.lang.jnaerator.JNAerator.jnaerationCore(JNAerator.java:1465)
at com.ochafik.lang.jnaerator.JNAerator.jnaerate(JNAerator.java:1018)
at com.nativelibs4java.opencl.generator.JavaCLGeneratorMojo.generateAll(JavaCLGeneratorMojo.java:160)
... 22 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant