Skip to content

General parallel processing support

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

dynamicbutter/com.imagibee.pcc

 
 

Repository files navigation

com.imagibee.parallel

A Unity package supporting a variety of parallel computations. The package includes:

  • SumJob - computes the sum of the elements of an array
  • ProductJob - computes the element-wise product of two arrays
  • PccJob - computes the Pearson correlation coefficient of two arrays

Usage

Here is a brief example that illustrates the usage. Refer to Runtime/Pcc.cs to see how SumJob and ProductJob may be combined to form more complex computations.

using Imagibee.Parallel;

var x = new float[] { 1, 2, 3, 4, 5 };
var y = new float[] { -1, -2, -3, -4, -5 };
var pccJob = new PccJob()
{
    Allocator = Allocator.Persistent,
    Length = x.Length,
    Width = x.Length / 2
};
pccJob.Allocate();
pccJob.X.CopyFrom(x);
pccJob.Y.CopyFrom(x);
pccJob.Schedule().Complete();
var pccXX = pccJob.Result.Value;
pccJob.Y.CopyFrom(y);
pccJob.Schedule().Complete();
var pccYY = pccJob.Result.Value;
pccJob.Dispose();
Assert.AreEqual(1f, pccXX);
Assert.AreEqual(-1f, pccYY);

License

MIT

Dependencies

Versioning

This package uses semantic versioning. Tags on the main branch indicate versions. It is recomended to use a tagged version. The latest version on the main branch should be considered under development when it is not tagged.

Installation

This package is intended to be used from an existing Unity project. Using the Package Manager select Add package from git URL... and provide the URL to the version you want in this git repository.

Testing

The package includes Functional and Performance tests. To run the tests open the Test Runner. Select the Imagibee.Parallel.Tests.dll and Run Selected. If the tests do not show up in the Test Runner you might need to add the following entry to your manifest file.

"testables": [
    "com.imagibee.parallel"
  ]

Issues

Report and track issues here.

Contributing

Minor changes such as bug fixes and performance improvements are welcome any time. Simply make a pull request. Please discuss more significant changes prior to making the pull request by opening a new issue that describes the change.

About

General parallel processing support

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%