jordan30001 / aparapi

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

kernel.getAccumulatedExecutionTime() returns zero #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the black-scholes example
2. Observe the total execution time
3.

What is the expected output? What do you see instead?
The expected output is the actual execution time per iteration. Instead, I get 
a 0 (zero).

What version of the product are you using? On what operating system?
2012-05-06

Please provide any additional information below.

Original issue reported on code.google.com by dmitrinesteruk on 30 May 2012 at 10:28

GoogleCodeExporter commented 9 years ago
I am sorry I am unable to reproduce this. I get a valid value (233ms) 

Do you get the same 0 when you execute in JTP mode?

What OS is this?  Is this using the binary distribution or are you building 
from the trunk?

Gary

Original comment by frost.g...@gmail.com on 3 Jun 2012 at 6:10

GoogleCodeExporter commented 9 years ago
I'm not sure what JTP mode is - I'm definitely running this on the GPU. I am 
using Windows 7, and the binary distribution of Aparapi. The black-scholes 
samples is compiled and executed under IDEA Ultimate.

Original comment by dmitrinesteruk on 5 Jun 2012 at 7:07

GoogleCodeExporter commented 9 years ago
This is odd. 

JTP (Java Thread Pool execution) is the fallback mode in case Aparapi fails to 
convert bytecode to OpenCL.  Sounds like your quite sure that you are executing 
on the GPU.

You can force JTP mode by setting the Java property 

-Dcom.amd.aparapi.executionMode=JTP 

From the command line. This forces all Kernels to be executed in a thread pool 
(as if OpenCL were not available). 

Alternatively from the code you can call

kernel.setExecutionMode(Kernel.EXECUTION_MODE.JTP);

Prior to calling 

kernel.execute(....);

The execution time is captured by using System.currentTimeMillis() inside the 
Kernel/KernelRunner.  We capture one value at the start, and another at the end 
and just subtract the two.  I can't understand how this can be 0. Unless you 
have some uber-super-fast machine...

There is another option. 

We added a Profiling option recently. Maybe you can try it. 

Turn on profiling from the commandline with 
-Dcom.amd.aparapi.enableProfiling=true

Then in your code (after kernel.execute() has completed) 

List<ProfileInfo> profileInfoList = kernel.getProfileInfo();
for (ProfileInfo profileInfo : profileInfoList) {
    System.out.println(profileInfo);
}

This will report how long it took to txfer buffers and execute the kernel on 
the GPU. 

Gary

Original comment by frost.g...@gmail.com on 7 Jun 2012 at 10:51

GoogleCodeExporter commented 9 years ago
Unable to reproduce.

Please try the latest Trunk code and let us know if you are still experiencing 
this issue. Thanks!

Original comment by ryan.lam...@gmail.com on 22 Apr 2013 at 5:06