From 0a71e4f02aaf5e319c8dac26311b9b46d4764ef4 Mon Sep 17 00:00:00 2001 From: Ruyman Reyes Date: Mon, 10 Jul 2017 10:46:19 +0100 Subject: [PATCH 1/2] Placeholder accessors can be default constructed * Placeholder accessor constructor can optionally not take memobj * Handler can specify the buffer later on --- placeholder_accessors/index.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/placeholder_accessors/index.md b/placeholder_accessors/index.md index 8308e4b..ba935a1 100644 --- a/placeholder_accessors/index.md +++ b/placeholder_accessors/index.md @@ -9,7 +9,7 @@ | Reply-to | Ruyman Reyes | | Original author | Ruyman Reyes | | Requirements | CP001 | -| Contributors | Gordon Brown , Victor Lomuller , Mehdi Goli , Peter Zuzek , Luke Iwanski | +| Contributors | Gordon Brown , Victor Lomuller , Mehdi Goli , Peter Zuzek , Luke Iwanski , Michael Haidl | ## Overview @@ -172,7 +172,10 @@ except for the aforementioned modifications. ### When `is_placeholder` returns true -The accessor API features constructors that don't take the handler parameter. +The accessor API features constructors that don't take the handler parameter +and/or memory object as a constructor. Accessors can then be default +constructed, and the memory object can be assigned later when registering +the accessor in the command group. In addition, a new method to obtain a normal accessor from the placeholder accessor is provided. @@ -192,6 +195,12 @@ The handler gains a new method, that registers the requirements of the placeholder accessor on the given command group. +Another method, that allows specifying the memory object the placeholder +accessor will be associated is also provided: + +`handler::require(buffer b, + accessor)` + [1]: https://github.com/codeplaysoftware/sycl-blas "SYCL-BLAS" [2]: https://github.com/lukeiwanski/tensorflow "TensorFlow/Eigen" From 117519e1cf0df09ded96484e5de7a1f549d22957 Mon Sep 17 00:00:00 2001 From: Christopher Di Bella Date: Thu, 3 Aug 2017 16:12:44 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Providing=20explicit=20documentation=20for?= =?UTF-8?q?=20throwing=20an=20exception=20when=20no=20bu=E2=80=A6=20(#21)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Providing explicit documentation for throwing an exception when no buffer exists. * Removed implementation details and provided interface specification only. * Applied fixes to Gordon's review * Changed has_buffer to be a const function * Changed wording for the placeholder accessor buffer --- placeholder_accessors/index.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/placeholder_accessors/index.md b/placeholder_accessors/index.md index ba935a1..6dd2e2c 100644 --- a/placeholder_accessors/index.md +++ b/placeholder_accessors/index.md @@ -175,7 +175,7 @@ except for the aforementioned modifications. The accessor API features constructors that don't take the handler parameter and/or memory object as a constructor. Accessors can then be default constructed, and the memory object can be assigned later when registering -the accessor in the command group. +the accessor in the command group. In addition, a new method to obtain a normal accessor from the placeholder accessor is provided. @@ -199,8 +199,18 @@ Another method, that allows specifying the memory object the placeholder accessor will be associated is also provided: `handler::require(buffer b, - accessor)` + accessor)` +### Placeholder `accessor` without a buffer + +If a placeholder accessor which was not constructed with a buffer is not tied +to a buffer within a command group, then an exception is thrown. An accessor +can be checked for the existence of an associated a buffer using `has_buffer()`. + +|Member function |Description | +|-----------------------|---------------------------------------------------------| +|bool has_buffer() const|Returns true if the accessor is associated with a buffer,| +| |and false otherwise. | [1]: https://github.com/codeplaysoftware/sycl-blas "SYCL-BLAS" [2]: https://github.com/lukeiwanski/tensorflow "TensorFlow/Eigen"