LibreOffice Module sc (master) 1
op_math.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#pragma once
11
12#include "opbase.hxx"
13#include "utils.hxx"
14
15namespace sc::opencl {
16
20{
22 const std::string &sSymName, SubArguments &vSubArguments) override;
24 virtual void GenerateCode( outputstream& ss ) const = 0;
25};
26
30{
32 const std::string &sSymName, SubArguments &vSubArguments) override;
34 virtual void GenerateCode( outputstream& ss ) const = 0;
35};
36
37
39{
40public:
41 virtual std::string BinFuncName() const override { return "Cos"; }
42 virtual void GenerateCode( outputstream& ss ) const override;
43};
44
46{
47public:
48 virtual std::string BinFuncName() const override { return "Sec"; }
49 virtual void GenerateCode( outputstream& ss ) const override;
50};
51
53{
54public:
55 virtual std::string BinFuncName() const override { return "SecH"; }
56 virtual void GenerateCode( outputstream& ss ) const override;
57};
58
60{
61public:
62 virtual std::string BinFuncName() const override { return "MROUND"; }
63 virtual void GenerateCode( outputstream& ss ) const override;
64};
65
67{
68public:
69 virtual std::string BinFuncName() const override { return "Csc"; }
70 virtual void GenerateCode( outputstream& ss ) const override;
71};
72
73class OpSumIfs final : public CheckVariables
74{
75public:
78 const std::string &sSymName, SubArguments &vSubArguments) override;
79 virtual std::string BinFuncName() const override { return "SumIfs"; }
81private:
83};
84
86{
87public:
88 virtual std::string BinFuncName() const override { return "Cosh"; }
89 virtual void BinInlineFun(std::set<std::string>& ,std::set<std::string>& ) override;
90 virtual void GenerateCode( outputstream& ss ) const override;
91};
92
94{
95public:
96 virtual std::string BinFuncName() const override { return "Sinh"; }
97 virtual void GenerateCode( outputstream& ss ) const override;
98};
99
101{
102public:
103 virtual std::string BinFuncName() const override { return "Sin"; }
104 virtual void GenerateCode( outputstream& ss ) const override;
105};
106
108{
109public:
110 virtual std::string BinFuncName() const override { return "ScAbs"; }
111 virtual void GenerateCode( outputstream& ss ) const override;
112};
113
115{
116public:
117 virtual std::string BinFuncName() const override { return "ScACos"; }
118 virtual void BinInlineFun(std::set<std::string>& ,std::set<std::string>&) override;
119 virtual void GenerateCode( outputstream& ss ) const override;
120};
121
123{
124public:
125 virtual std::string GetBottom() override { return "1.0"; }
126 virtual std::string BinFuncName() const override { return "ScACosH"; }
127 virtual void GenerateCode( outputstream& ss ) const override;
128};
129
131{
132public:
133 virtual std::string BinFuncName() const override { return "Tan"; }
134 virtual void GenerateCode( outputstream& ss ) const override;
135};
136
138{
139public:
140 virtual std::string BinFuncName() const override { return "TanH"; }
141 virtual void GenerateCode( outputstream& ss ) const override;
142};
143
145{
146public:
147 virtual std::string BinFuncName() const override { return "Sqrt"; }
148 virtual void GenerateCode( outputstream& ss ) const override;
149};
150
152{
153public:
154 virtual std::string BinFuncName() const override { return "ScACot"; }
155 virtual void GenerateCode( outputstream& ss ) const override;
156};
157
159{
160public:
161 virtual std::string BinFuncName() const override { return "ScACotH"; }
162 virtual void GenerateCode( outputstream& ss ) const override;
163};
164
166{
167public:
168 virtual std::string BinFuncName() const override { return "ScASin"; }
169 virtual void BinInlineFun(std::set<std::string>& ,std::set<std::string>&) override;
170 virtual void GenerateCode( outputstream& ss ) const override;
171};
172
174{
175public:
176 virtual std::string BinFuncName() const override { return "ScASinH"; }
177 virtual void GenerateCode( outputstream& ss ) const override;
178};
179
181{
182public:
183 virtual std::string BinFuncName() const override { return "ScATan2"; }
184 virtual void BinInlineFun(std::set<std::string>& ,std::set<std::string>&) override;
185 virtual void GenerateCode( outputstream& ss ) const override;
186};
187
189{
190public:
191 virtual std::string BinFuncName() const override { return "ScATan"; }
192 virtual void GenerateCode( outputstream& ss ) const override;
193};
194
196{
197public:
198 virtual std::string BinFuncName() const override { return "ScATanH"; }
199 virtual void GenerateCode( outputstream& ss ) const override;
200};
201
203{
204public:
205 virtual std::string BinFuncName() const override { return "ScBitAnd"; }
206 virtual void GenerateCode( outputstream& ss ) const override;
207};
208
210{
211public:
212 virtual std::string BinFuncName() const override { return "ScBitOr"; }
213 virtual void GenerateCode( outputstream& ss ) const override;
214};
215
217{
218public:
219 virtual std::string BinFuncName() const override { return "ScBitXor"; }
220 virtual void GenerateCode( outputstream& ss ) const override;
221};
222
224{
225public:
226 virtual std::string BinFuncName() const override { return "ScBitLshift"; }
227 virtual void GenerateCode( outputstream& ss ) const override;
228};
229
231{
232public:
233 virtual std::string BinFuncName() const override { return "ScBitRshift"; }
234 virtual void GenerateCode( outputstream& ss ) const override;
235};
236
238{
239public:
240 virtual std::string BinFuncName() const override { return "Ln"; }
241 virtual void GenerateCode( outputstream& ss ) const override;
242};
243
244class OpRound: public Normal
245{
246public:
247 virtual void GenSlidingWindowFunction(outputstream &ss,
248 const std::string &sSymName, SubArguments &vSubArguments) override;
249 virtual std::string BinFuncName() const override { return "Round"; }
250 virtual void BinInlineFun(std::set<std::string>& , std::set<std::string>& ) override;
251};
252class OpRoundUp: public Normal
253{
254public:
255 virtual void GenSlidingWindowFunction(outputstream &ss,
256 const std::string &sSymName, SubArguments &vSubArguments) override;
257 virtual std::string BinFuncName() const override { return "RoundUp"; }
258};
259class OpRoundDown: public Normal
260{
261public:
262 virtual void GenSlidingWindowFunction(outputstream &ss,
263 const std::string &sSymName, SubArguments &vSubArguments) override;
264 virtual std::string BinFuncName() const override { return "RoundDown"; }
265};
266class OpTrunc: public OpRoundDown
267{
268public:
269 virtual std::string BinFuncName() const override { return "Trunc"; }
270};
272{
273public:
274 virtual std::string BinFuncName() const override { return "Int"; }
275 virtual void GenerateCode( outputstream& ss ) const override;
276 virtual void BinInlineFun(std::set<std::string>& , std::set<std::string>& ) override;
277};
278
280{
281public:
282 virtual std::string BinFuncName() const override { return "Radians"; }
283 virtual void GenerateCode( outputstream& ss ) const override;
284};
285
287{
288public:
289 virtual std::string BinFuncName() const override { return "IsEven"; }
290 virtual void GenerateCode( outputstream& ss ) const override;
291};
292
294{
295public:
296 virtual std::string BinFuncName() const override { return "IsOdd"; }
297 virtual void GenerateCode( outputstream& ss ) const override;
298};
299
301{
302public:
303 virtual std::string BinFuncName() const override { return "Cot"; }
304 virtual void GenerateCode( outputstream& ss ) const override;
305};
306
307class OpSumSQ: public Normal
308{
309public:
310 virtual void GenSlidingWindowFunction(outputstream &ss,
311 const std::string &sSymName, SubArguments &vSubArguments) override;
312
313 virtual std::string BinFuncName() const override { return "SumSQ"; }
314 virtual bool canHandleMultiVector() const override { return true; }
315};
316
318{
319public:
320 virtual void BinInlineFun(std::set<std::string>& ,
321 std::set<std::string>& ) override;
322 virtual std::string BinFuncName() const override { return "Coth"; }
323 virtual void GenerateCode( outputstream& ss ) const override;
324};
325
327{
328public:
329 virtual std::string BinFuncName() const override { return "Power"; }
330 virtual void GenerateCode( outputstream& ss ) const override;
331};
332
334{
335public:
336 virtual void BinInlineFun(std::set<std::string>& ,std::set<std::string>&) override;
337 virtual std::string BinFuncName() const override { return "Odd"; }
338 virtual void GenerateCode( outputstream& ss ) const override;
339};
340
341class OpFloor: public Normal
342{
343public:
344 virtual void GenSlidingWindowFunction(outputstream &ss,
345 const std::string &sSymName, SubArguments &vSubArguments) override;
346 virtual std::string BinFuncName() const override { return "Floor"; }
347};
348
350{
351public:
352 virtual std::string BinFuncName() const override { return "CscH"; }
353 virtual void GenerateCode( outputstream& ss ) const override;
354};
355
356class OpCeil:public Normal{
357public:
358 virtual void GenSlidingWindowFunction(outputstream &ss,
359 const std::string &sSymName, SubArguments &vSubArguments) override;
360 virtual std::string GetBottom() override { return "0.0"; }
361 virtual std::string BinFuncName() const override { return "ScCeil"; }
362};
363
365{
366public:
367 virtual std::string BinFuncName() const override { return "Exp"; }
368 virtual void GenerateCode( outputstream& ss ) const override;
369};
370
372{
373public:
374 virtual std::string BinFuncName() const override { return "Log10"; }
375 virtual void GenerateCode( outputstream& ss ) const override;
376};
377
379{
380public:
381 virtual std::string BinFuncName() const override { return "Even"; }
382 virtual void GenerateCode( outputstream& ss ) const override;
383};
384
386{
387public:
388 virtual void GenSlidingWindowFunction(outputstream &ss,
389 const std::string &sSymName, SubArguments &vSubArguments) override;
390 virtual std::string BinFuncName() const override { return "AverageIfs"; }
391};
393{
394public:
395 virtual void GenSlidingWindowFunction(outputstream &ss,
396 const std::string &sSymName, SubArguments &vSubArguments) override;
397 virtual std::string BinFuncName() const override { return "CountIfs"; }
398};
400{
401public:
402 virtual std::string BinFuncName() const override { return "Mod"; }
403 virtual void GenerateCode( outputstream& ss ) const override;
404 virtual void BinInlineFun(std::set<std::string>& ,std::set<std::string>& ) override;
405};
406
407class OpProduct: public Normal
408{
409public:
410 virtual void GenSlidingWindowFunction(outputstream &ss,
411 const std::string &sSymName, SubArguments &vSubArguments) override;
412 virtual std::string BinFuncName() const override { return "Product"; }
413 virtual bool canHandleMultiVector() const override { return true; }
414};
415
417{
418public:
419 virtual std::string BinFuncName() const override { return "SqrtPi"; }
420 virtual void GenerateCode( outputstream& ss ) const override;
421};
422
424{
425public:
426 virtual std::string BinFuncName() const override { return "Combina"; }
427 virtual void BinInlineFun(std::set<std::string>& ,std::set<std::string>& ) override;
428 virtual void GenerateCode( outputstream& ss ) const override;
429};
430
431class OpLog: public Normal
432{
433public:
434 virtual void GenSlidingWindowFunction(outputstream &ss,
435 const std::string &sSymName, SubArguments &vSubArguments) override;
436
437 virtual std::string BinFuncName() const override { return "Log"; }
438};
439
441{
442public:
443 virtual std::string BinFuncName() const override { return "ScCombin"; }
444 virtual void GenerateCode( outputstream& ss ) const override;
445};
446
448{
449public:
450 virtual void GenSlidingWindowFunction(outputstream &ss,
451 const std::string &sSymName, SubArguments &vSubArguments) override;
452
453 virtual std::string BinFuncName() const override { return "AverageIf"; }
454};
456{
457public:
458 virtual std::string BinFuncName() const override { return "Degrees"; }
459 virtual void GenerateCode( outputstream& ss ) const override;
460};
461
462class OpCountIf: public Normal
463{
464public:
465 virtual void GenSlidingWindowFunction(outputstream &ss,
466 const std::string &sSymName, SubArguments &vSubArguments) override;
467 virtual std::string BinFuncName() const override { return "Countif"; }
468};
470{
471public:
472 virtual std::string BinFuncName() const override { return "Fact"; }
473 virtual void GenerateCode( outputstream& ss ) const override;
474};
475
476class OpSeriesSum: public Normal
477{
478public:
479 virtual void GenSlidingWindowFunction(outputstream &ss,
480 const std::string &sSymName, SubArguments &vSubArguments) override;
481 virtual std::string BinFuncName() const override { return "SeriesSum"; }
482 virtual bool canHandleMultiVector() const override { return true; }
483};
484class OpSumIf: public Normal
485{
486public:
487 virtual void GenSlidingWindowFunction(outputstream &ss,
488 const std::string &sSymName, SubArguments &vSubArguments) override;
489 virtual std::string BinFuncName() const override { return "SumIf"; }
490};
491
493{
494public:
495 virtual std::string BinFuncName() const override { return "Quotient"; }
496 virtual void GenerateCode( outputstream& ss ) const override;
497};
498
500{
501public:
502 virtual std::string BinFuncName() const override { return "NegSub"; }
503 virtual void GenerateCode( outputstream& ss ) const override;
504};
505
506class OpEqual : public Normal
507{
508public:
509 virtual void GenSlidingWindowFunction(outputstream &ss,
510 const std::string &sSymName, SubArguments &vSubArguments) override;
511 virtual std::string BinFuncName() const override { return "eq"; }
512 virtual void BinInlineFun(std::set<std::string>& , std::set<std::string>& ) override;
513 virtual bool takeString() const override { return true; }
514};
515
516class OpNotEqual : public Normal
517{
518public:
519 virtual void GenSlidingWindowFunction(outputstream &ss,
520 const std::string &sSymName, SubArguments &vSubArguments) override;
521 virtual std::string BinFuncName() const override { return "neq"; }
522 virtual void BinInlineFun(std::set<std::string>& , std::set<std::string>& ) override;
523 virtual bool takeString() const override { return true; }
524};
525
527{
528public:
529 virtual void GenerateCode( outputstream& ss ) const override;
530 virtual std::string BinFuncName() const override { return "le"; }
531 virtual void BinInlineFun(std::set<std::string>& , std::set<std::string>& ) override;
532};
533
535{
536public:
537 virtual void GenerateCode( outputstream& ss ) const override;
538 virtual std::string BinFuncName() const override { return "lt"; }
539};
540
542{
543public:
544 virtual void GenerateCode( outputstream& ss ) const override;
545 virtual std::string BinFuncName() const override { return "ge"; }
546 virtual void BinInlineFun(std::set<std::string>& , std::set<std::string>& ) override;
547};
548
550{
551public:
552 virtual void GenerateCode( outputstream& ss ) const override;
553 virtual std::string BinFuncName() const override { return "gt"; }
554};
555
557{
558public:
559 virtual void GenSlidingWindowFunction( outputstream& ss,
560 const std::string& sSymName, SubArguments& vSubArguments ) override;
561 virtual bool takeString() const override { return false; }
562 virtual bool takeNumeric() const override { return true; }
563};
564
566{
567public:
568 virtual std::string Gen2( const std::string& lhs, const std::string& rhs ) const override
569 {
570 return lhs + "*" + rhs;
571 }
572 virtual std::string BinFuncName() const override { return "fsop"; }
573};
574
576class OpNop : public Reduction
577{
578public:
579 explicit OpNop(int nResultSize) : Reduction(nResultSize) {}
580
581 virtual std::string GetBottom() override { return "0"; }
582 virtual std::string Gen2( const std::string& lhs, const std::string& ) const override
583 {
584 return lhs;
585 }
586 virtual std::string BinFuncName() const override { return "nop"; }
587};
588
589class OpSum : public Reduction
590{
591public:
592 explicit OpSum(int nResultSize) : Reduction(nResultSize) {}
593
594 virtual std::string GetBottom() override { return "0"; }
595 virtual std::string Gen2( const std::string& lhs, const std::string& rhs ) const override
596 {
597 outputstream ss;
598 ss << "fsum_approx((" << lhs << "),(" << rhs << "))";
599 return ss.str();
600 }
601 virtual void BinInlineFun(std::set<std::string>& decls,std::set<std::string>& funs) override;
602 virtual std::string BinFuncName() const override { return "fsum"; }
603 // All arguments are simply summed, so it doesn't matter if SvDoubleVector is split.
604 virtual bool canHandleMultiVector() const override { return true; }
605};
606
607class OpSub : public Reduction
608{
609public:
610 explicit OpSub(int nResultSize) : Reduction(nResultSize) {}
611
612 virtual std::string GetBottom() override { return "0"; }
613 virtual std::string Gen2( const std::string& lhs, const std::string& rhs ) const override
614 {
615 return "fsub_approx(" + lhs + "," + rhs + ")";
616 }
617 virtual void BinInlineFun(std::set<std::string>& decls,std::set<std::string>& funs) override;
618 virtual std::string BinFuncName() const override { return "fsub"; }
619};
620
621class OpMul : public Reduction
622{
623public:
624 explicit OpMul(int nResultSize) : Reduction(nResultSize) {}
625
626 virtual std::string GetBottom() override { return "1"; }
627 virtual std::string Gen2( const std::string& lhs, const std::string& rhs ) const override
628 {
629 return lhs + "*" + rhs;
630 }
631 virtual std::string BinFuncName() const override { return "fmul"; }
632 virtual bool ZeroReturnZero() override { return true; }
633};
634
636class OpDiv : public Reduction
637{
638public:
639 explicit OpDiv(int nResultSize) : Reduction(nResultSize) {}
640
641 virtual std::string GetBottom() override { return "1.0"; }
642 virtual std::string Gen2( const std::string& lhs, const std::string& rhs ) const override
643 {
644 return "(" + rhs + "==0 ? CreateDoubleError(DivisionByZero) : (" + lhs + "/" + rhs + ") )";
645 }
646 virtual std::string BinFuncName() const override { return "fdiv"; }
647
648 virtual bool HandleNaNArgument( outputstream& ss, unsigned argno, SubArguments& vSubArguments ) const override
649 {
650 if (argno == 1)
651 {
652 ss <<
653 "if (isnan(" << vSubArguments[argno]->GenSlidingWindowDeclRef() << ")) {\n"
654 " return CreateDoubleError(DivisionByZero);\n"
655 "}\n";
656 return true;
657 }
658 else if (argno == 0)
659 {
660 ss <<
661 "if (isnan(" << vSubArguments[argno]->GenSlidingWindowDeclRef() << ") &&\n"
662 " !(isnan(" << vSubArguments[1]->GenSlidingWindowDeclRef() << ") || " << vSubArguments[1]->GenSlidingWindowDeclRef() << " == 0)) {\n"
663 " return 0;\n"
664 "}\n";
665 }
666 return false;
667 }
668
669};
670
671}
672
673/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:134
virtual std::string BinFuncName() const override
Definition: op_math.hxx:110
virtual std::string GetBottom() override
Definition: op_math.hxx:125
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:151
virtual std::string BinFuncName() const override
Definition: op_math.hxx:126
virtual std::string BinFuncName() const override
Definition: op_math.hxx:117
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:146
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:139
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:181
virtual std::string BinFuncName() const override
Definition: op_math.hxx:161
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:176
virtual std::string BinFuncName() const override
Definition: op_math.hxx:154
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:198
virtual std::string BinFuncName() const override
Definition: op_math.hxx:176
virtual std::string BinFuncName() const override
Definition: op_math.hxx:168
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:193
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:186
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:417
virtual std::string BinFuncName() const override
Definition: op_math.hxx:183
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:424
virtual std::string BinFuncName() const override
Definition: op_math.hxx:198
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:208
virtual std::string BinFuncName() const override
Definition: op_math.hxx:191
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:203
virtual std::string BinFuncName() const override
Definition: op_math.hxx:453
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:1268
virtual std::string BinFuncName() const override
Definition: op_math.hxx:390
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:832
virtual std::string BinFuncName() const override
Definition: op_math.hxx:205
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:429
virtual std::string BinFuncName() const override
Definition: op_math.hxx:226
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:450
virtual std::string BinFuncName() const override
Definition: op_math.hxx:212
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:436
virtual std::string BinFuncName() const override
Definition: op_math.hxx:233
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:461
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:443
virtual std::string BinFuncName() const override
Definition: op_math.hxx:219
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:1228
virtual std::string GetBottom() override
Definition: op_math.hxx:360
virtual std::string BinFuncName() const override
Definition: op_math.hxx:361
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:316
virtual std::string BinFuncName() const override
Definition: op_math.hxx:426
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:323
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:346
virtual std::string BinFuncName() const override
Definition: op_math.hxx:443
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:46
virtual std::string BinFuncName() const override
Definition: op_math.hxx:41
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:68
virtual std::string BinFuncName() const override
Definition: op_math.hxx:88
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:61
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:73
virtual std::string BinFuncName() const override
Definition: op_math.hxx:303
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:79
virtual std::string BinFuncName() const override
Definition: op_math.hxx:322
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:86
virtual std::string BinFuncName() const override
Definition: op_math.hxx:467
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:976
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:578
virtual std::string BinFuncName() const override
Definition: op_math.hxx:397
virtual std::string BinFuncName() const override
Definition: op_math.hxx:352
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:108
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:103
virtual std::string BinFuncName() const override
Definition: op_math.hxx:69
virtual std::string BinFuncName() const override
Definition: op_math.hxx:458
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:259
Technically not a reduction, but fits the framework.
Definition: op_math.hxx:637
OpDiv(int nResultSize)
Definition: op_math.hxx:639
virtual std::string GetBottom() override
Definition: op_math.hxx:641
virtual bool HandleNaNArgument(outputstream &ss, unsigned argno, SubArguments &vSubArguments) const override
Definition: op_math.hxx:648
virtual std::string BinFuncName() const override
Definition: op_math.hxx:646
virtual std::string Gen2(const std::string &lhs, const std::string &rhs) const override
Definition: op_math.hxx:642
virtual bool takeString() const override
Definition: op_math.hxx:513
virtual std::string BinFuncName() const override
Definition: op_math.hxx:511
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:477
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:488
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:91
virtual std::string BinFuncName() const override
Definition: op_math.hxx:381
virtual std::string BinFuncName() const override
Definition: op_math.hxx:367
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:113
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:264
virtual std::string BinFuncName() const override
Definition: op_math.hxx:472
virtual std::string BinFuncName() const override
Definition: op_math.hxx:346
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:1187
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:555
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:546
virtual std::string BinFuncName() const override
Definition: op_math.hxx:545
virtual std::string BinFuncName() const override
Definition: op_math.hxx:553
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:560
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:229
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:220
virtual std::string BinFuncName() const override
Definition: op_math.hxx:274
virtual std::string BinFuncName() const override
Definition: op_math.hxx:289
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:244
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:249
virtual std::string BinFuncName() const override
Definition: op_math.hxx:296
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:527
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:536
virtual std::string BinFuncName() const override
Definition: op_math.hxx:530
virtual std::string BinFuncName() const override
Definition: op_math.hxx:538
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:541
virtual std::string BinFuncName() const override
Definition: op_math.hxx:240
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:215
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:118
virtual std::string BinFuncName() const override
Definition: op_math.hxx:374
virtual std::string BinFuncName() const override
Definition: op_math.hxx:437
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:565
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:308
virtual std::string BinFuncName() const override
Definition: op_math.hxx:62
Implements functions in the form of FUNC(x), e.g.
Definition: op_math.hxx:20
virtual void GenerateCode(outputstream &ss) const =0
This writes out OpenCL code returning the computed value, the argument is "arg0".
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:20
Implements functions in the form of FUNC(x1, x2), e.g.
Definition: op_math.hxx:30
virtual void GenerateCode(outputstream &ss) const =0
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:32
virtual std::string BinFuncName() const override
Definition: op_math.hxx:402
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:387
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:399
virtual std::string GetBottom() override
Definition: op_math.hxx:626
virtual std::string BinFuncName() const override
Definition: op_math.hxx:631
OpMul(int nResultSize)
Definition: op_math.hxx:624
virtual bool ZeroReturnZero() override
Definition: op_math.hxx:632
virtual std::string Gen2(const std::string &lhs, const std::string &rhs) const override
Definition: op_math.hxx:627
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:234
virtual std::string BinFuncName() const override
Definition: op_math.hxx:502
operator traits
Definition: op_math.hxx:577
virtual std::string Gen2(const std::string &lhs, const std::string &) const override
Definition: op_math.hxx:582
virtual std::string GetBottom() override
Definition: op_math.hxx:581
virtual std::string BinFuncName() const override
Definition: op_math.hxx:586
OpNop(int nResultSize)
Definition: op_math.hxx:579
virtual std::string BinFuncName() const override
Definition: op_math.hxx:521
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:502
virtual bool takeString() const override
Definition: op_math.hxx:523
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:513
virtual std::string BinFuncName() const override
Definition: op_math.hxx:337
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:285
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:292
virtual std::string BinFuncName() const override
Definition: op_math.hxx:329
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:412
virtual bool canHandleMultiVector() const override
Definition: op_math.hxx:413
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:1249
virtual std::string BinFuncName() const override
Definition: op_math.hxx:412
virtual std::string BinFuncName() const override
Definition: op_math.hxx:495
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the arguments are "arg0" and "arg1".
Definition: op_math.cxx:472
virtual std::string BinFuncName() const override
Definition: op_math.hxx:282
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:239
virtual std::string BinFuncName() const override
Definition: op_math.hxx:264
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:948
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:920
virtual std::string BinFuncName() const override
Definition: op_math.hxx:257
virtual void BinInlineFun(std::set< std::string > &, std::set< std::string > &) override
Definition: op_math.cxx:885
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:892
virtual std::string BinFuncName() const override
Definition: op_math.hxx:249
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:56
virtual std::string BinFuncName() const override
Definition: op_math.hxx:55
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:51
virtual std::string BinFuncName() const override
Definition: op_math.hxx:48
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:1420
virtual std::string BinFuncName() const override
Definition: op_math.hxx:481
virtual bool canHandleMultiVector() const override
Definition: op_math.hxx:482
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:128
virtual std::string BinFuncName() const override
Definition: op_math.hxx:103
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:123
virtual std::string BinFuncName() const override
Definition: op_math.hxx:96
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:254
virtual std::string BinFuncName() const override
Definition: op_math.hxx:419
virtual std::string BinFuncName() const override
Definition: op_math.hxx:147
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:169
OpSub(int nResultSize)
Definition: op_math.hxx:610
virtual std::string BinFuncName() const override
Definition: op_math.hxx:618
virtual void BinInlineFun(std::set< std::string > &decls, std::set< std::string > &funs) override
Definition: op_math.cxx:1645
virtual std::string GetBottom() override
Definition: op_math.hxx:612
virtual std::string Gen2(const std::string &lhs, const std::string &rhs) const override
Definition: op_math.hxx:613
virtual std::string BinFuncName() const override
Definition: op_math.hxx:489
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:1074
bool NeedReductionKernel() const
Definition: op_math.hxx:80
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:626
virtual std::string BinFuncName() const override
Definition: op_math.hxx:79
virtual std::string Gen2(const std::string &lhs, const std::string &rhs) const override
Definition: op_math.hxx:568
virtual std::string BinFuncName() const override
Definition: op_math.hxx:572
virtual bool canHandleMultiVector() const override
Definition: op_math.hxx:314
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:1213
virtual std::string BinFuncName() const override
Definition: op_math.hxx:313
virtual std::string GetBottom() override
Definition: op_math.hxx:594
virtual std::string BinFuncName() const override
Definition: op_math.hxx:602
virtual bool canHandleMultiVector() const override
Definition: op_math.hxx:604
virtual std::string Gen2(const std::string &lhs, const std::string &rhs) const override
Definition: op_math.hxx:595
virtual void BinInlineFun(std::set< std::string > &decls, std::set< std::string > &funs) override
Definition: op_math.cxx:1635
OpSum(int nResultSize)
Definition: op_math.hxx:592
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:164
virtual std::string BinFuncName() const override
Definition: op_math.hxx:140
virtual std::string BinFuncName() const override
Definition: op_math.hxx:133
virtual void GenerateCode(outputstream &ss) const override
This writes out OpenCL code returning the computed value, the argument is "arg0".
Definition: op_math.cxx:158
virtual std::string BinFuncName() const override
Definition: op_math.hxx:269
std::vector< DynamicKernelArgumentRef > SubArguments
Definition: opbase.hxx:347
virtual bool takeString() const override
Definition: op_math.hxx:561
virtual bool takeNumeric() const override
Definition: op_math.hxx:562
virtual void GenSlidingWindowFunction(outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments) override
Definition: op_math.cxx:1446