MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / doConstruct

Method doConstruct

src/library/blas/gens/kprintf.cpp:2100–2199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2098}
2099
2100void kprintf::doConstruct(const char *type, int vecWidth, bool doVLOAD, bool doVSTORE, int _wgSize)
2101{
2102 this->doVLOAD = doVLOAD;
2103 this->doVSTORE = doVSTORE;
2104 this->wgSize = _wgSize;
2105
2106 if ((strcmp(type, "single") != 0) &&
2107 (strcmp(type,"double") != 0) &&
2108 (strcmp(type,"complex") != 0) &&
2109 (strcmp(type,"doublecomplex") != 0))
2110 {
2111 std::cout << "kprint() constructor: Type is not supported" << std::endl;
2112 throw -1;
2113 }
2114
2115 if (vecWidth <= 0)
2116 {
2117 std::cout << "kprint() constructor: vecWidth is <= 0" << std::endl;
2118 throw -1;
2119 }
2120
2121 maxKeySize = 0; // NOTE: This has to be done before REGISTERING types. Dependency on "put"
2122
2123 //
2124 // Arrive at %TYPE and %TYPE%V attributes
2125 //
2126 if (strcmp(type,"single") == 0)
2127 {
2128 put("%PTYPE", "float"); // Primitive Type
2129 put("%PREFIX", "S"); // Prefix
2130 registerType("float", vecWidth);
2131 }
2132
2133 if (strcmp(type,"double") == 0)
2134 {
2135 put("%PTYPE", "double"); // Primitive Type
2136 put("%PREFIX", "D"); // Prefix
2137 registerType("double", vecWidth);
2138 }
2139
2140 if (strcmp(type,"complex") == 0)
2141 {
2142 put("%PTYPE", "float"); // Primitive Type
2143 put("%PREFIX", "C"); // Prefix
2144 registerType("float2", vecWidth, 2);
2145 }
2146
2147 if (strcmp(type,"doublecomplex") == 0)
2148 {
2149 put("%PTYPE", "double"); // Primitive Type
2150 put("%PREFIX", "Z"); // Prefix
2151 registerType("double2", vecWidth, 2);
2152 }
2153
2154 registerVSTORE(); //Get "%VSTORE_VALUE" - This is for internal use to handle %VLOAD
2155
2156 put("%VLOAD", NULL);
2157 put("%VSTORE", NULL);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected