File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Core/src/test/java/com/nativelibs4java/opencl Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .nativelibs4java .opencl ;
2+
3+ import org .junit .Test ;
4+
5+ public class SweatTest {
6+ static {
7+ System .setProperty ("bridj.debug.pointer.releases" , "true" );
8+ }
9+ @ Test
10+ public void sweatTest () {
11+ long tot = 0 ;
12+ for (boolean cached : new boolean [] { false , true }) {
13+ for (int time = 0 ; time < 100 ; time ++) {
14+ CLContext context = JavaCL .createBestContext (CLPlatform .DeviceFeature .GPU );
15+ CLQueue queue = context .createDefaultQueue ();
16+ CLProgram program = context .createProgram ("kernel void f(global int* a) { a[0] = 1; }" );
17+ program .setCached (cached );
18+ program .build ();
19+ CLKernel kernel = program .createKernel ("f" );
20+ kernel .release ();
21+ program .release ();
22+ queue .release ();
23+ context .release ();
24+ System .gc ();
25+ }
26+ }
27+ System .out .println (tot );
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments