A permissively licensed C and C++ Task Scheduler for creating parallel programs. Requires C++11 support.
A permissively licensed C and C++ Task Scheduler for creating parallel programs. Requires C++11 support.
Support development of enkiTS through Github Sponsors or Patreon
A permissively licensed C and C++ Task Scheduler for creating parallel programs. Requires C++11 support.
The primary goal of enkiTS is to help developers create programs which handle both data and task level parallelism to utilize the full performance of multicore CPUs, whilst being lightweight (only a small amount of code) and easy to use.
enkiTS was developed for, and is used in enkisoftware's Avoyd codebase.
enkiTS is primarily developed on x64 and x86 Intel architectures on MS Windows, with well tested support for Linux and somewhat less frequently tested support on Mac OS and ARM Android.
Several examples exist in the example folder.
For further examples, see https://github.com/dougbinks/enkiTSExamples
Building enkiTS is simple, just add the files in enkiTS/src to your build system (_c.* files can be ignored if you only need C++ interface), and add enkiTS/src to your include path. Unix / Linux builds will likely require the pthreads library.
For C++
#include "TaskScheduler.h"TaskScheduler.cppFor C
#include "TaskScheduler_c.h"TaskScheduler.cppTaskScheduler_c.cppFor cmake, on Windows / Mac OS X / Linux with cmake installed, open a prompt in the enkiTS directory and:
mkdir buildcd buildcmake ..make all or for Visual Studio open enkiTS.slnI recommend using enkiTS directly from source in each project rather than installing it for system wide use. However enkiTS' cmake script can also be used to install the library
if the ENKITS_INSTALL cmake variable is set to ON (it defaults to OFF).
When installed the header files are installed in a subdirectory of the include path, include/enkiTS to ensure that they do not conflict with header files from other packages.
When building applications either ensure this is part of the INCLUDE_PATH variable or ensure that enkiTS is in the header path in the source files, for example use #include "enkiTS/TaskScheduler.h" instead of #include "TaskScheduler.h".
…
#include "TaskScheduler.h"
enki::TaskScheduler g_TS;
int main(int argc, const char * argv[]) {
g_TS.Initialize();
enki::TaskSet task( 1, []( enki::TaskSetPartition range_, uint32_t threadnum_ ) {
// do something here
} );
g_TS.AddTaskSetToPipe( &task );
g_TS.WaitforTask( &task );
return 0;
}
…
…
…
…
…
The C++98 compatible branch has been deprecated as I'm not aware of anyone needing it.
The user thread versions are no longer being maintained as they are no longer in use. Similar functionality can be obtained with the externalTaskThreads
Avoyd is an abstract 6 degrees of freedom voxel game. enkiTS was developed for use in our in-house engine powering Avoyd.
GPU/CPU Texture Generator
Aras Pranckevičius' code for his series on Daily Path Tracer experiments with various languages.
.
Marco Castorina and Gabriel Sassone's book on developing a modern rendering engine from first principles using the Vulkan API. enkiTS is used as the task library to distribute work across cores.
Copyright (c) 2013-2020 Doug Binks
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
No open issues yet, or sync has not completed.