Skip to content

Commit

Permalink
add custom taskflow fork
Browse files Browse the repository at this point in the history
  • Loading branch information
samayala22 committed Feb 8, 2024
1 parent a7871c7 commit 5914b0b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
30 changes: 30 additions & 0 deletions packages/taskflow.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package("taskflow_custom", function()
set_urls("https://github.com/samayala22/taskflow.git")
add_urls("https://github.com/samayala22/taskflow/archive/$(version).tar.gz")
add_versions("v3.6.2", "0a1d306f90e8e17cb98b95eaae9e8b9455beeeca0f0a72afee7719b27706c68c")

if is_plat("linux") then
add_syslinks("pthread")
end

on_install("linux", "macosx", "windows", "iphoneos", "android", "cross", "mingw", "bsd", function (package)
os.cp("taskflow", package:installdir("include"))
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <taskflow/taskflow.hpp>
#include <taskflow/algorithm/for_each.hpp>
static void test() {
tf::Executor executor;
tf::Taskflow taskflow;
std::vector<int> range(10);
std::iota(range.begin(), range.end(), 0);
taskflow.for_each(range.begin(), range.end(), [&] (int i) {
std::printf("for_each on container item: %d\n", i);
});
executor.run(taskflow).wait();
}
]]}, {configs = {languages = "c++17"}}))
end)
end)
4 changes: 2 additions & 2 deletions vlm/backends/avx2/src/vlm_backend_avx2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void BackendAVX2::compute_lhs(const FlowData& flow) {
auto init = taskflow.placeholder();
auto sync = taskflow.placeholder();

auto wing_pass = taskflow.for_each_index(start_wing, end_wing, (u32)1, [&] (u32 i) {
auto wing_pass = taskflow.for_each_index(start_wing, end_wing, [&] (u32 i) {
macro_kernel_avx2<true>(m, lhs, i, i, sigma_p4);
macro_kernel_remainder_scalar<true>(m, lhs, i, i);
}, tf::GuidedPartitioner());
Expand All @@ -320,7 +320,7 @@ void BackendAVX2::compute_lhs(const FlowData& flow) {
auto cond = taskflow.emplace([&]{
return idx < m.nc + m.nw ? 0 : 1; // 0 means continue, 1 means break
});
auto wake_pass = taskflow.for_each_index(0u, m.ns, (u32)1, [&] (u32 j) {
auto wake_pass = taskflow.for_each_index(0u, m.ns, [&] (u32 j) {
const u32 ia = (m.nc - 1) * m.ns + j;
const u32 lidx = idx * m.ns + j;
macro_kernel_avx2<false>(m, lhs, ia, lidx, sigma_p4);
Expand Down
7 changes: 4 additions & 3 deletions vlm/backends/avx2/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
includes("../../../packages/taskflow.lua")

add_requires("tbb")

add_requires("openblas")
add_requires("taskflow")
add_requires("taskflow_custom")

target("backend-avx2")
set_kind("static")
set_default(false)
add_vectorexts("avx2", "fma")
add_packages("tbb")
add_packages("taskflow")
add_packages("taskflow_custom")
add_defines("HAVE_LAPACK_CONFIG_H")
add_packages("openblas", { public = true })

add_includedirs("../../include")
add_files("src/*.cpp")
add_includedirs("include", {public = true})

0 comments on commit 5914b0b

Please sign in to comment.