55
66#include < concepts>
77
8+ #include " ck_tile/builder/testing/tensor_descriptor.hpp"
9+ #include " ck_tile/builder/testing/tensor_buffer.hpp"
810#include " ck_tile/builder/testing/validation.hpp"
911
1012// / This file is the main header for the CK-Builder testing system. A high-level
@@ -132,8 +134,8 @@ struct Outputs;
132134// / be created using `alloc_inputs()` and that an instance of the corresponding
133135// / `Inputs` structure can be obtained using `.get()`.
134136// /
135- // / @note The easiest way to implement this type is to use the `DeviceBuffer `
136- // / type to allocate individual device buffers for each input tensor .
137+ // / @note A default implementation is provided for this type if `Inputs `
138+ // / supports `TensorReflectable` .
137139// /
138140// / @tparam SIGNATURE The signature to specialize the structure for.
139141// /
@@ -151,8 +153,8 @@ struct UniqueInputs;
151153// / be created using `alloc_outputs()` and that an instance of the corresponding
152154// / `Outputs` structure can be obtained using `.get()`.
153155// /
154- // / @note The easiest way to implement this type is to use the `DeviceBuffer `
155- // / type to allocate individual device buffers for each output tensor .
156+ // / @note A default implementation is provided for this type if `Outputs `
157+ // / supports `TensorReflectable` .
156158// /
157159// / @tparam SIGNATURE The signature to specialize the structure for.
158160// /
@@ -197,6 +199,12 @@ concept ValidUniqueOutputs = requires(UniqueOutputs<SIGNATURE>& inputs) {
197199// / amount of memory required and then allocate it on the device, for example
198200// / using `alloc_buffer` or `alloc_tensor_buffer`.
199201// /
202+ // / @note This function is explicitly deleted to generate compile errors
203+ // / for missing implementations.
204+ // /
205+ // / @note A default implementation is provided for this function if `Inputs`
206+ // / supports `TensorReflectable`.
207+ // /
200208// / @tparam SIGNATURE The signature to specialize the structure for.
201209// /
202210// / @param args The run-time arguments of the operation.
@@ -207,22 +215,22 @@ concept ValidUniqueOutputs = requires(UniqueOutputs<SIGNATURE>& inputs) {
207215// / @see alloc_tensor_buffer()
208216template <auto SIGNATURE >
209217 requires ValidUniqueInputs<SIGNATURE >
210- UniqueInputs<SIGNATURE > alloc_inputs (const Args<SIGNATURE >& args);
218+ UniqueInputs<SIGNATURE > alloc_inputs (const Args<SIGNATURE >& args) = delete ;
211219
212- // / @brief Allocate inputs corresponding to a signature.
220+ // / @brief Initialize inputs corresponding to a signature.
213221// /
214222// / The `init_inputs()` function is used to initialize pseudo-random data
215223// / to the tensors specified in the Inputs structure. Implementors should
216224// / fill each of the tensors in `inputs` with appropriate random data.
217225// /
226+ // / @note This function is explicitly deleted to generate compile errors
227+ // / for missing implementations.
228+ // /
218229// / @tparam SIGNATURE the signature to specialize the structure for.
219230// /
220231// / @param args The run-time arguments of the operation.
221232// / @param inputs The operation inputs to initialize with random data.
222233// /
223- // / @note This function is explicitly deleted to generate compile errors
224- // / for missing implementations.
225- // /
226234// / @see Inputs
227235// / @see tensor_initialization
228236template <auto SIGNATURE >
@@ -235,13 +243,16 @@ void init_inputs(const Args<SIGNATURE>& args, Inputs<SIGNATURE> inputs) = delete
235243// / amount of memory required and then allocate it on the device, for example
236244// / using `alloc_buffer` or `alloc_tensor_buffer`.
237245// /
246+ // / @note This function is explicitly deleted to generate compile errors
247+ // / for missing implementations.
248+ // /
249+ // / @note A default implementation is provided for this function if `Outputs`
250+ // / supports `TensorReflectable`.
251+ // /
238252// / @tparam SIGNATURE The signature to specialize the structure for.
239253// /
240254// / @param args The run-time arguments of the operation.
241255// /
242- // / @note This function is explicitly deleted to generate compile errors
243- // / for missing implementations.
244- // /
245256// / @see Outputs
246257// / @see UniqueOutputs
247258// / @see alloc_buffer()
@@ -262,15 +273,15 @@ UniqueInputs<SIGNATURE> alloc_outputs(const Args<SIGNATURE>& args) = delete;
262273// / were incorrect, and where (a subset of) those elements are located within
263274// / the tensor. See `ValidationReport` for more information about the report.
264275// /
276+ // / @note This function is explicitly deleted to generate compile errors
277+ // / for missing implementations.
278+ // /
265279// / @tparam SIGNATURE The signature to specialize the structure for.
266280// /
267281// / @param args The run-time arguments of the operation.
268282// / @param actual The actual results, the results of the operation to-be-tested.
269283// / @param expected The expected results, the results of the reference implementation.
270284// /
271- // / @note This function is explicitly deleted to generate compile errors
272- // / for missing implementations.
273- // /
274285// / @see ValidationReport
275286template <auto SIGNATURE >
276287ValidationReport validate (const Args<SIGNATURE >& args,
0 commit comments