top of page

Hello World

  • htugrulbuyukisik
  • 14 Nis 2017
  • 1 dakikada okunur

New programming methods are not complete without a simplest traditional "hello world" output, are they? Here it is:

ClNumberCruncher cr = new ClNumberCruncher( AcceleratorType.GPU, @"

__kernel void hello(__global char * arr)

{

printf(""hello world"");

}

");

ClArray<byte> array = new ClArray<byte>(1000); // or new byte[1000], both works

array.compute(cr, 1, "hello", 1000, 100); // 1000 workitems, 100 per workgroup

this code fragment chooses all available GPUs in PC and pushes a byte array to all of them, computes(each workitem prints "hello world" on console) and then gets byte array results back to same array. Actually byte array is not changed in this example. The OpenCL kernel needs to alter it using "arr" parameter.

 
 
 

Comentarios


Why GPGPU? 
  • Offload image-resize to all GPUs and FPGAs so server feels more relaxed to host websites

  • Move compute-heavy sql table joins to C# side to let sql server handle the data-heavy parts.

  • Make particle physics programs performance-aware, even a mild overclock to one of GPUs will increase overall performance.

  • Write your own genuine kernel code to accomplish multi-GPU computing, easily without getting low-level on host side.

 UPCOMING VERSIONS: 

 

  • Device to device pipelining

 

  • Built-in image resizer functions.

 

  • Built-in matrix-multiplication functions.

 

 FOLLOW Cekirdekler: 
  • Twitter B&W
 RECENT POSTS: 
 SEARCH BY TAGS: 

© 2017 by Huseyin Tugrul BUYUKISIK. Proudly created with Wix.com

  • Twitter B&W
bottom of page