huixiangufl / aparapi

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

Adding Vector data type at Aparapi #164

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to write a Java program with vector data type(like Float4) and 
running it on HSA device.

The vector data type is using renderscript's "Float4.java". The example(VecAdd) 
I write can compile but there's an error when running Aparapi. The error 
messages are

damn!
Exception in thread "main" java.lang.NullPointerException
        at com.amd.aparapi.HSAILAssembler.addmov(HSAILAssembler.java:451)
        at com.amd.aparapi.HSAILAssembler.addInstructions(HSAILAssembler.java:739)
        at com.amd.aparapi.HSAILAssembler.addInstructions(HSAILAssembler.java:1275)
        at com.amd.aparapi.HSAILMethod.<init>(HSAILMethod.java:454)
        at com.amd.aparapi.HSAILMethod.getHSAILMethod(HSAILMethod.java:390)
        at com.amd.aparapi.HSADevice.getCachedRunner(HSADevice.java:59)
        at com.amd.aparapi.HSADevice.forEach(HSADevice.java:126)
        at com.amd.aparapi.sample.add.HSAAdd.main(HSAAdd.java:73)

I don't know that "damn" means ?
Is means Aparapi doesn't support Vector data type or not.

The attached file is Renderscript Float4.java. The another is java samples 
using vector data type.

Original issue reported on code.google.com by brian780...@gmail.com on 13 Apr 2015 at 3:52

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Brian

 (Copying our offline discussion here) 

Not really sure what to say. 

Aparapi does not support vector types (it could, but does not at present) so it 
will not generate HSAIL vector instructions. 

Looks like you are trying to use Renderscripts representation types with 
Aparapi to 'force it' to use vector types... That is not going to work.  
Renderscript only uses these as 'holders' for passing off to ScriptC_XXXX 
generated API's for binding to Renderscript's 'real' float4 type. 

You might have more success adding your own vector types, and trying to map 
these to HSAIL by changing the Assembler.

Original comment by frost.g...@gmail.com on 13 Apr 2015 at 4:16