O'Reilly logo

Hands-On Machine Learning with C# by Matt R. Cole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Weaver

The weaver is a critical component of Kelp.Net and is the first object call you will make when running a test. This object houses a variety of OpenCL objects such as:

  • ComputeContext
  • An array of ComputeDevices
  • ComputeCommandQueue
  • A Boolean flag indicating if the GPU is enabled
  • ComputePlatform
  • A dictionary of KernelSources

The weaver is the place to tell your program whether you will be using a CPU or GPU, and which device (if your system is capable of multiple devices) you will be using. You only need to make a single call to the weaver, at the beginning of your program, similar to what you see here:

Weaver.Initialize(ComputeDeviceTypes.Gpu);

You also can avoid using the initialization call of the weaver and allow it to determine ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required