File indexing completed on 2026-04-09 07:49:09
0001 #pragma once
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #if defined(__CUDACC__) || defined(__CUDABE__)
0021 #define QPOLY_METHOD __host__ __device__
0022 #else
0023 #define QPOLY_METHOD
0024 #endif
0025
0026
0027 struct Poly
0028 {
0029 float width ;
0030 float height;
0031
0032 QPOLY_METHOD void set_param(float width_, float height_ )
0033 {
0034 width=width_;
0035 height=height_;
0036 }
0037 QPOLY_METHOD virtual float area(){ return 0.f; }
0038 };
0039
0040
0041 struct RectangleV1 : Poly
0042 {
0043 QPOLY_METHOD float area(){ return width * height + 0.1f ; }
0044 };
0045
0046 struct RectangleV2 : Poly
0047 {
0048 QPOLY_METHOD float area(){ return width * height + 0.2f ; }
0049 };
0050
0051 struct TriangleV1 : Poly
0052 {
0053 QPOLY_METHOD float area(){ return width*height/2.f + 0.1f ; }
0054 };
0055
0056 struct TriangleV2 : Poly
0057 {
0058 QPOLY_METHOD float area(){ return width*height/2.f + 0.2f ; }
0059 };
0060
0061
0062
0063
0064
0065
0066
0067