[arrayfire] 102/408: PERF: Speeding up JIT for 3D arrays in OpenCL backends
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:11:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/sid
in repository arrayfire.
commit f8e9398a7e60da758b525211f855ec6b3882689f
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Fri Jul 3 00:52:43 2015 -0400
PERF: Speeding up JIT for 3D arrays in OpenCL backends
---
src/backend/opencl/jit.cpp | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/backend/opencl/jit.cpp b/src/backend/opencl/jit.cpp
index f21f858..088d3a3 100644
--- a/src/backend/opencl/jit.cpp
+++ b/src/backend/opencl/jit.cpp
@@ -83,19 +83,19 @@ static string getKernelString(string funcName, Node *node, bool is_linear)
if (!is_linear) {
kerStream << "uint id0 = 0, id1 = 0, id2 = 0, id3 = 0;\n";
- kerStream << "if (num_odims == 4) {\n";
+ kerStream << "if (num_odims > 2) {\n";
+
kerStream << "id2 = get_group_id(0) / groups_0;" << "\n";
- kerStream << "id3 = get_group_id(1) / groups_1;" << "\n";
kerStream << "id0 = get_group_id(0) - id2 * groups_0;" << "\n";
- kerStream << "id1 = get_group_id(1) - id3 * groups_1;" << "\n";
kerStream << "id0 = get_local_id(0) + id0 * get_local_size(0);" << "\n";
+
+ kerStream << "if (num_odims > 3) {\n";
+ kerStream << "id3 = get_group_id(1) / groups_1;" << "\n";
+ kerStream << "id1 = get_group_id(1) - id3 * groups_1;" << "\n";
kerStream << "id1 = get_local_id(1) + id1 * get_local_size(1);" << "\n";
- kerStream << " } else if (num_odims == 3) {\n";
- kerStream << "id2 = get_group_id(0) / groups_0;" << "\n";
- kerStream << "id3 = 0;" << "\n";
- kerStream << "id0 = get_group_id(0) - id2 * groups_0;" << "\n";
+ kerStream << "} else {\n";
kerStream << "id1 = get_global_id(1);" << "\n";
- kerStream << "id0 = get_local_id(0) + id0 * get_local_size(0);" << "\n";
+ kerStream << "}\n";
kerStream << " } else {\n";
kerStream << "id3 = 0;" << "\n";
kerStream << "id2 = 0;" << "\n";
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git
More information about the debian-science-commits
mailing list