clEvaluator.h
Go to the documentation of this file.
1 //
2 // Copyright 2015 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24
25 #ifndef OPENSUBDIV_OPENSUBDIV3_OSD_CL_EVALUATOR_H
26 #define OPENSUBDIV_OPENSUBDIV3_OSD_CL_EVALUATOR_H
27
28 #include "../version.h"
29
30 #include "../osd/opencl.h"
31 #include "../osd/types.h"
32 #include "../osd/bufferDescriptor.h"
33
34 namespace OpenSubdiv {
35 namespace OPENSUBDIV_VERSION {
36
37 namespace Far {
38 class StencilTable;
39 }
40
41 namespace Osd {
42
50 class CLStencilTable {
51 public:
52 template <typename DEVICE_CONTEXT>
53 static CLStencilTable *Create(Far::StencilTable const *stencilTable,
54 DEVICE_CONTEXT context) {
55 return new CLStencilTable(stencilTable, context->GetContext());
56 }
57
58 template <typename DEVICE_CONTEXT>
59 static CLStencilTable *Create(
60 Far::LimitStencilTable const *limitStencilTable,
61 DEVICE_CONTEXT context) {
62 return new CLStencilTable(limitStencilTable, context->GetContext());
63 }
64
65 CLStencilTable(Far::StencilTable const *stencilTable,
66 cl_context clContext);
67 CLStencilTable(Far::LimitStencilTable const *limitStencilTable,
68 cl_context clContext);
69 ~CLStencilTable();
70
71 // interfaces needed for CLComputeKernel
72 cl_mem GetSizesBuffer() const { return _sizes; }
73 cl_mem GetOffsetsBuffer() const { return _offsets; }
74 cl_mem GetIndicesBuffer() const { return _indices; }
75 cl_mem GetWeightsBuffer() const { return _weights; }
76 cl_mem GetDuWeightsBuffer() const { return _duWeights; }
77 cl_mem GetDvWeightsBuffer() const { return _dvWeights; }
78 int GetNumStencils() const { return _numStencils; }
79
80 private:
81 cl_mem _sizes;
82 cl_mem _offsets;
83 cl_mem _indices;
84 cl_mem _weights;
85 cl_mem _duWeights;
86 cl_mem _dvWeights;
87 int _numStencils;
88 };
89
90 // ---------------------------------------------------------------------------
91
92 class CLEvaluator {
93 public:
94 typedef bool Instantiatable;
96 CLEvaluator(cl_context context, cl_command_queue queue);
97
99 ~CLEvaluator();
100
102 template <typename DEVICE_CONTEXT>
103 static CLEvaluator *Create(BufferDescriptor const &srcDesc,
104 BufferDescriptor const &dstDesc,
105 BufferDescriptor const &duDesc,
106 BufferDescriptor const &dvDesc,
107 DEVICE_CONTEXT deviceContext) {
108 return Create(srcDesc, dstDesc, duDesc, dvDesc,
109 deviceContext->GetContext(),
110 deviceContext->GetCommandQueue());
111 }
112
113 static CLEvaluator * Create(BufferDescriptor const &srcDesc,
114 BufferDescriptor const &dstDesc,
115 BufferDescriptor const &duDesc,
116 BufferDescriptor const &dvDesc,
117 cl_context clContext,
118 cl_command_queue clCommandQueue) {
119 CLEvaluator *kernel = new CLEvaluator(clContext, clCommandQueue);
120 if (kernel->Compile(srcDesc, dstDesc, duDesc, dvDesc)) return kernel;
121 delete kernel;
122 return NULL;
123 }
124
130
174 template <typename SRC_BUFFER, typename DST_BUFFER,
175 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
176 static bool EvalStencils(
177 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
178 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
179 STENCIL_TABLE const *stencilTable,
180 CLEvaluator const *instance,
181 DEVICE_CONTEXT deviceContext,
182 unsigned int numStartEvents=0,
183 const cl_event* startEvents=NULL,
184 cl_event* endEvent=NULL) {
185
186 if (instance) {
187 return instance->EvalStencils(srcBuffer, srcDesc,
188 dstBuffer, dstDesc,
189 stencilTable,
190 numStartEvents, startEvents, endEvent);
191 } else {
192 // Create an instance on demand (slow)
193 instance = Create(srcDesc, dstDesc,
194 BufferDescriptor(),
195 BufferDescriptor(),
196 deviceContext);
197 if (instance) {
198 bool r = instance->EvalStencils(srcBuffer, srcDesc,
199 dstBuffer, dstDesc,
200 stencilTable,
201 numStartEvents, startEvents, endEvent);
202 delete instance;
203 return r;
204 }
205 return false;
206 }
207 }
208
264 template <typename SRC_BUFFER, typename DST_BUFFER,
265 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
266 static bool EvalStencils(
267 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
268 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
269 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
270 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
271 STENCIL_TABLE const *stencilTable,
272 CLEvaluator const *instance,
273 DEVICE_CONTEXT deviceContext,
274 unsigned int numStartEvents=0,
275 const cl_event* startEvents=NULL,
276 cl_event* endEvent=NULL) {
277
278 if (instance) {
279 return instance->EvalStencils(srcBuffer, srcDesc,
280 dstBuffer, dstDesc,
281 duBuffer, duDesc,
282 dvBuffer, dvDesc,
283 stencilTable,
284 numStartEvents, startEvents, endEvent);
285 } else {
286 // Create an instance on demand (slow)
287 instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
288 deviceContext);
289 if (instance) {
290 bool r = instance->EvalStencils(srcBuffer, srcDesc,
291 dstBuffer, dstDesc,
292 duBuffer, duDesc,
293 dvBuffer, dvDesc,
294 stencilTable,
295 numStartEvents, startEvents, endEvent);
296 delete instance;
297 return r;
298 }
299 return false;
300 }
301 }
302
306 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
307 bool EvalStencils(
308 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
309 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
310 STENCIL_TABLE const *stencilTable,
311 unsigned int numStartEvents=0,
312 const cl_event* startEvents=NULL,
313 cl_event* endEvent=NULL) const {
314 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
315 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
316 stencilTable->GetSizesBuffer(),
317 stencilTable->GetOffsetsBuffer(),
318 stencilTable->GetIndicesBuffer(),
319 stencilTable->GetWeightsBuffer(),
320 0,
321 stencilTable->GetNumStencils(),
322 numStartEvents, startEvents, endEvent);
323 }
324
328 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
329 bool EvalStencils(
330 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
331 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
332 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
333 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
334 STENCIL_TABLE const *stencilTable,
335 unsigned int numStartEvents=0,
336 const cl_event* startEvents=NULL,
337 cl_event* endEvent=NULL) const {
338 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
339 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
340 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
341 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
342 stencilTable->GetSizesBuffer(),
343 stencilTable->GetOffsetsBuffer(),
344 stencilTable->GetIndicesBuffer(),
345 stencilTable->GetWeightsBuffer(),
346 stencilTable->GetDuWeightsBuffer(),
347 stencilTable->GetDvWeightsBuffer(),
348 0,
349 stencilTable->GetNumStencils(),
350 numStartEvents, startEvents, endEvent);
351 }
352
355 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
356 cl_mem dst, BufferDescriptor const &dstDesc,
357 cl_mem sizes,
358 cl_mem offsets,
359 cl_mem indices,
360 cl_mem weights,
361 int start,
362 int end,
363 unsigned int numStartEvents=0,
364 const cl_event* startEvents=NULL,
365 cl_event* endEvent=NULL) const;
366
369 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
370 cl_mem dst, BufferDescriptor const &dstDesc,
371 cl_mem du, BufferDescriptor const &duDesc,
372 cl_mem dv, BufferDescriptor const &dvDesc,
373 cl_mem sizes,
374 cl_mem offsets,
375 cl_mem indices,
376 cl_mem weights,
377 cl_mem duWeights,
378 cl_mem dvWeights,
379 int start,
380 int end,
381 unsigned int numStartEvents=0,
382 const cl_event* startEvents=NULL,
383 cl_event* endEvent=NULL) const;
384
439 template <typename SRC_BUFFER, typename DST_BUFFER,
440 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
441 typename DEVICE_CONTEXT>
442 static bool EvalPatches(
443 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
444 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
445 int numPatchCoords,
446 PATCHCOORD_BUFFER *patchCoords,
447 PATCH_TABLE *patchTable,
448 CLEvaluator const *instance,
449 DEVICE_CONTEXT deviceContext,
450 unsigned int numStartEvents=0,
451 const cl_event* startEvents=NULL,
452 cl_event* endEvent=NULL) {
453
454 if (instance) {
455 return instance->EvalPatches(srcBuffer, srcDesc,
456 dstBuffer, dstDesc,
457 numPatchCoords, patchCoords,
458 patchTable,
459 numStartEvents, startEvents, endEvent);
460 } else {
461 // Create an instance on demand (slow)
462 (void)deviceContext; // unused
463 instance = Create(srcDesc, dstDesc,
464 BufferDescriptor(),
465 BufferDescriptor(),
466 deviceContext);
467 if (instance) {
468 bool r = instance->EvalPatches(srcBuffer, srcDesc,
469 dstBuffer, dstDesc,
470 numPatchCoords, patchCoords,
471 patchTable,
472 numStartEvents, startEvents, endEvent);
473 delete instance;
474 return r;
475 }
476 return false;
477 }
478 }
479
536 template <typename SRC_BUFFER, typename DST_BUFFER,
537 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
538 typename DEVICE_CONTEXT>
539 static bool EvalPatches(
540 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
541 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
542 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
543 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
544 int numPatchCoords,
545 PATCHCOORD_BUFFER *patchCoords,
546 PATCH_TABLE *patchTable,
547 CLEvaluator const *instance,
548 DEVICE_CONTEXT deviceContext,
549 unsigned int numStartEvents=0,
550 const cl_event* startEvents=NULL,
551 cl_event* endEvent=NULL) {
552
553 if (instance) {
554 return instance->EvalPatches(srcBuffer, srcDesc,
555 dstBuffer, dstDesc,
556 duBuffer, duDesc,
557 dvBuffer, dvDesc,
558 numPatchCoords, patchCoords,
559 patchTable,
560 numStartEvents, startEvents, endEvent);
561 } else {
562 // Create an instance on demand (slow)
563 (void)deviceContext; // unused
564 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, deviceContext);
565 if (instance) {
566 bool r = instance->EvalPatches(srcBuffer, srcDesc,
567 dstBuffer, dstDesc,
568 duBuffer, duDesc,
569 dvBuffer, dvDesc,
570 numPatchCoords, patchCoords,
571 patchTable,
572 numStartEvents, startEvents, endEvent);
573 delete instance;
574 return r;
575 }
576 return false;
577 }
578 }
579
617 template <typename SRC_BUFFER, typename DST_BUFFER,
618 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
619 bool EvalPatches(
620 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
621 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
622 int numPatchCoords,
623 PATCHCOORD_BUFFER *patchCoords,
624 PATCH_TABLE *patchTable,
625 unsigned int numStartEvents=0,
626 const cl_event* startEvents=NULL,
627 cl_event* endEvent=NULL) const {
628
629 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
630 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
631 0, BufferDescriptor(),
632 0, BufferDescriptor(),
633 numPatchCoords,
634 patchCoords->BindCLBuffer(_clCommandQueue),
635 patchTable->GetPatchArrayBuffer(),
636 patchTable->GetPatchIndexBuffer(),
637 patchTable->GetPatchParamBuffer(),
638 numStartEvents, startEvents, endEvent);
639 }
640
688 template <typename SRC_BUFFER, typename DST_BUFFER,
689 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
690 bool EvalPatches(
691 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
692 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
693 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
694 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
695 int numPatchCoords,
696 PATCHCOORD_BUFFER *patchCoords,
697 PATCH_TABLE *patchTable,
698 unsigned int numStartEvents=0,
699 const cl_event* startEvents=NULL,
700 cl_event* endEvent=NULL) const {
701
702 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
703 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
704 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
705 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
706 numPatchCoords,
707 patchCoords->BindCLBuffer(_clCommandQueue),
708 patchTable->GetPatchArrayBuffer(),
709 patchTable->GetPatchIndexBuffer(),
710 patchTable->GetPatchParamBuffer(),
711 numStartEvents, startEvents, endEvent);
712 }
713
714 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc,
715 cl_mem dst, BufferDescriptor const &dstDesc,
716 cl_mem du, BufferDescriptor const &duDesc,
717 cl_mem dv, BufferDescriptor const &dvDesc,
718 int numPatchCoords,
719 cl_mem patchCoordsBuffer,
720 cl_mem patchArrayBuffer,
721 cl_mem patchIndexBuffer,
722 cl_mem patchParamsBuffer,
723 unsigned int numStartEvents=0,
724 const cl_event* startEvents=NULL,
725 cl_event* endEvent=NULL) const;
726
775 template <typename SRC_BUFFER, typename DST_BUFFER,
776 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
777 typename DEVICE_CONTEXT>
778 static bool EvalPatchesVarying(
779 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
780 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
781 int numPatchCoords,
782 PATCHCOORD_BUFFER *patchCoords,
783 PATCH_TABLE *patchTable,
784 CLEvaluator const *instance,
785 DEVICE_CONTEXT deviceContext,
786 unsigned int numStartEvents=0,
787 const cl_event* startEvents=NULL,
788 cl_event* endEvent=NULL) {
789
790 if (instance) {
791 return instance->EvalPatchesVarying(
792 srcBuffer, srcDesc,
793 dstBuffer, dstDesc,
794 numPatchCoords, patchCoords,
795 patchTable,
796 numStartEvents, startEvents, endEvent);
797 } else {
798 // Create an instance on demand (slow)
799 (void)deviceContext; // unused
800 instance = Create(srcDesc, dstDesc,
801 BufferDescriptor(),
802 BufferDescriptor(),
803 deviceContext);
804 if (instance) {
805 bool r = instance->EvalPatchesVarying(
806 srcBuffer, srcDesc,
807 dstBuffer, dstDesc,
808 numPatchCoords, patchCoords,
809 patchTable,
810 numStartEvents, startEvents, endEvent);
811 delete instance;
812 return r;
813 }
814 return false;
815 }
816 }
817
855 template <typename SRC_BUFFER, typename DST_BUFFER,
856 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
857 bool EvalPatchesVarying(
858 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
859 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
860 int numPatchCoords,
861 PATCHCOORD_BUFFER *patchCoords,
862 PATCH_TABLE *patchTable,
863 unsigned int numStartEvents=0,
864 const cl_event* startEvents=NULL,
865 cl_event* endEvent=NULL) const {
866
867 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
868 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
869 0, BufferDescriptor(),
870 0, BufferDescriptor(),
871 numPatchCoords,
872 patchCoords->BindCLBuffer(_clCommandQueue),
873 patchTable->GetVaryingPatchArrayBuffer(),
874 patchTable->GetVaryingPatchIndexBuffer(),
875 patchTable->GetPatchParamBuffer(),
876 numStartEvents, startEvents, endEvent);
877 }
878
929 template <typename SRC_BUFFER, typename DST_BUFFER,
930 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
931 typename DEVICE_CONTEXT>
932 static bool EvalPatchesFaceVarying(
933 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
934 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
935 int numPatchCoords,
936 PATCHCOORD_BUFFER *patchCoords,
937 PATCH_TABLE *patchTable,
938 int fvarChannel,
939 CLEvaluator const *instance,
940 DEVICE_CONTEXT deviceContext,
941 unsigned int numStartEvents=0,
942 const cl_event* startEvents=NULL,
943 cl_event* endEvent=NULL) {
944
945 if (instance) {
946 return instance->EvalPatchesFaceVarying(
947 srcBuffer, srcDesc,
948 dstBuffer, dstDesc,
949 numPatchCoords, patchCoords,
950 patchTable, fvarChannel,
951 numStartEvents, startEvents, endEvent);
952 } else {
953 // Create an instance on demand (slow)
954 (void)deviceContext; // unused
955 instance = Create(srcDesc, dstDesc,
956 BufferDescriptor(),
957 BufferDescriptor(),
958 deviceContext);
959 if (instance) {
960 bool r = instance->EvalPatchesFaceVarying(
961 srcBuffer, srcDesc,
962 dstBuffer, dstDesc,
963 numPatchCoords, patchCoords,
964 patchTable, fvarChannel,
965 numStartEvents, startEvents, endEvent);
966 delete instance;
967 return r;
968 }
969 return false;
970 }
971 }
972
1012 template <typename SRC_BUFFER, typename DST_BUFFER,
1013 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1014 bool EvalPatchesFaceVarying(
1015 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1016 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1017 int numPatchCoords,
1018 PATCHCOORD_BUFFER *patchCoords,
1019 PATCH_TABLE *patchTable,
1020 int fvarChannel = 0,
1021 unsigned int numStartEvents=0,
1022 const cl_event* startEvents=NULL,
1023 cl_event* endEvent=NULL) const {
1024
1025 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
1026 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
1027 0, BufferDescriptor(),
1028 0, BufferDescriptor(),
1029 numPatchCoords,
1030 patchCoords->BindCLBuffer(_clCommandQueue),
1031 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
1032 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
1033 patchTable->GetFVarPatchParamBuffer(fvarChannel),
1034 numStartEvents, startEvents, endEvent);
1035 }
1036
1042
1045 bool Compile(BufferDescriptor const &srcDesc,
1046 BufferDescriptor const &dstDesc,
1047 BufferDescriptor const &duDesc,
1048 BufferDescriptor const &dvDesc);
1049
1051 template <typename DEVICE_CONTEXT>
1052 static void Synchronize(DEVICE_CONTEXT deviceContext) {
1053 Synchronize(deviceContext->GetCommandQueue());
1054 }
1055
1056 static void Synchronize(cl_command_queue queue);
1057
1058 private:
1059 cl_context _clContext;
1060 cl_command_queue _clCommandQueue;
1061 cl_program _program;
1062 cl_kernel _stencilKernel;
1063 cl_kernel _stencilDerivKernel;
1064 cl_kernel _patchKernel;
1065 };
1066
1067
1068 } // end namespace Osd
1069
1070 } // end namespace OPENSUBDIV_VERSION
1071 using namespace OPENSUBDIV_VERSION;
1072
1073 } // end namespace OpenSubdiv
1074
1075
1076 #endif // OPENSUBDIV_OPENSUBDIV3_OSD_CL_EVALUATOR_H
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Compile
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
Definition: clEvaluator.h:103
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::Create
static CLStencilTable * Create(Far::LimitStencilTable const *limitStencilTable, DEVICE_CONTEXT context)
Definition: clEvaluator.h:59
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:778
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, cl_context clContext, cl_command_queue clCommandQueue)
Definition: clEvaluator.h:113
OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable
Table of subdivision stencils.
Definition: stencilTable.h:125
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:857
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Definition: clEvaluator.h:329
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Instantiatable
bool Instantiatable
Definition: clEvaluator.h:94
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition: clEvaluator.h:690
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator
Definition: clEvaluator.h:92
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:932
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetSizesBuffer
cl_mem GetSizesBuffer() const
Definition: clEvaluator.h:72
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:442
OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable
Table of limit subdivision stencils.
Definition: stencilTable.h:333
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesFaceVarying
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:1014
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDvWeightsBuffer
cl_mem GetDvWeightsBuffer() const
Definition: clEvaluator.h:77
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:539
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Definition: clEvaluator.h:307
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetIndicesBuffer
cl_mem GetIndicesBuffer() const
Definition: clEvaluator.h:74
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable
OpenCL stencil table.
Definition: clEvaluator.h:50
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition: clEvaluator.h:619
OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers. Almost all Osd Evaluator APIs take BufferDescriptors along with device-specific buffer objects.
Definition: bufferDescriptor.h:61
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Synchronize
static void Synchronize(DEVICE_CONTEXT deviceContext)
Wait the OpenCL kernels finish.
Definition: clEvaluator.h:1052
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static compute function. This function has a same signature as other device kernels have so t...
Definition: clEvaluator.h:176
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetNumStencils
int GetNumStencils() const
Definition: clEvaluator.h:78
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::Create
static CLStencilTable * Create(Far::StencilTable const *stencilTable, DEVICE_CONTEXT context)
Definition: clEvaluator.h:53
OpenSubdiv
Definition: error.h:30
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetWeightsBuffer
cl_mem GetWeightsBuffer() const
Definition: clEvaluator.h:75
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDuWeightsBuffer
cl_mem GetDuWeightsBuffer() const
Definition: clEvaluator.h:76
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetOffsetsBuffer
cl_mem GetOffsetsBuffer() const
Definition: clEvaluator.h:73
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static compute function. This function has a same signature as other device kernels have so t...
Definition: clEvaluator.h:266