/** * Determine which line drawing function to use given the current * rendering context. * * Please update the summary flag _SWRAST_NEW_LINE if you add or remove * tests to this code. */ void _swrast_choose_line( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLboolean rgbmode = ctx->Visual.rgbMode; GLboolean specular = (ctx->Fog.ColorSumEnabled || (ctx->Light.Enabled && ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)); if (ctx->RenderMode == GL_RENDER) { if (ctx->Line.SmoothFlag) { /* antialiased lines */ _swrast_choose_aa_line_function(ctx); ASSERT(swrast->Line); } else if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Current || swrast->_FogEnabled || specular) { USE(general_line); } else if (ctx->Depth.Test || ctx->Line.Width != 1.0 || ctx->Line.StippleFlag) { /* no texture, but Z, fog, width>1, stipple, etc. */ if (rgbmode) #if CHAN_BITS == 32 USE(general_line); #else USE(rgba_line); #endif else USE(ci_line); } else {
void RB_TROFF_Generate_Doc_End( FILE *dest_doc, char *name ) { USE( dest_doc ); USE( name ); }
virtual void exec() { USE(READ, n, tsteps); USE(READWRITE, A, B); using exec_pol = NestedPolicy<ExecList<omp_parallel_for_exec, simd_exec>, Tile<TileList<tile_fixed<16>, tile_fixed<16>>>>; for (int t = 0; t < tsteps; ++t) { forallN<exec_pol>( RangeSegment{1, n - 1}, RangeSegment{1, n - 1}, [=](int i, int j) { B->at(i, j) = static_cast<T>(0.2) * (A->at(i, j) + A->at(i, j - 1) + A->at(i, 1 + j) + A->at(1 + i, j) + A->at(i - 1, j)); }); forallN<exec_pol>( RangeSegment{1, n - 1}, RangeSegment{1, n - 1}, [=](int i, int j) { A->at(i, j) = static_cast<T>(0.2) * (B->at(i, j) + B->at(i, j - 1) + B->at(i, 1 + j) + B->at(1 + i, j) + B->at(i - 1, j)); }); } }
virtual void init() { USE(READ, n); USE(READWRITE, A); Arr2D<T> *B = new Arr2D<T>{n, n}; for (int i = 0; i < n; i++) { for (int j = 0; j <= i; j++) A->at(i, j) = static_cast<T>(-j % n) / n + 1; for (int j = i + 1; j < n; j++) { A->at(i, j) = 0; } A->at(i, i) = 1; } for (int r = 0; r < n; ++r) for (int s = 0; s < n; ++s) B->at(r, s) = 0; for (int t = 0; t < n; ++t) for (int r = 0; r < n; ++r) for (int s = 0; s < n; ++s) B->at(r, s) += A->at(r, t) * A->at(s, t); for (int r = 0; r < n; ++r) for (int s = 0; s < n; ++s) A->at(r, s) = B->at(r, s); delete B; }
// Clearly duplicated and should be in a common place... static Eina_Bool _ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd, Ector_Rop op, Eina_Array *clips, unsigned int mul_col) { if (pd->pat) return EINA_FALSE; Ector_Renderer_Generic_Gradient_Radial_Data *gld; // FIXME: don't ignore clipping ! gld = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN); if (!pd->pat || !gld) return EINA_FALSE; eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, ector_renderer_draw(op, clips, mul_col)); USE(obj, cairo_arc, EINA_FALSE); USE(obj, cairo_fill, EINA_FALSE); cairo_arc(pd->parent->cairo, gld->radial.x, gld->radial.y, gld->radius, 0, 2 * M_PI); eo_do(obj, ector_renderer_cairo_base_fill()); cairo_fill(pd->parent->cairo); return EINA_TRUE; }
virtual void init() { USE(READ, ni, nj, nk, nl); USE(READWRITE, A, B, C, D); using init_pol = NestedPolicy<ExecList<simd_exec, simd_exec>>; forallN<init_pol>( RangeSegment{0, ni}, RangeSegment{0, nk}, [=](int i, int k) { A->at(i, k) = static_cast<T>((i * k + 1) % ni) / ni; }); forallN<init_pol>( RangeSegment{0, nk}, RangeSegment{0, ni}, [=](int k, int i) { B->at(k, i) = static_cast<T>(k * (i + 1) % ni) / ni; }); forallN<init_pol>( RangeSegment{0, nj}, RangeSegment{0, nl}, [=](int j, int l) { C->at(j, l) = static_cast<T>((j * (l + 3) + 1) % nl) / nl; }); forallN<init_pol>( RangeSegment{0, ni}, RangeSegment{0, nl}, [=](int i, int l) { D->at(i, l) = static_cast<T>(i * (l + 2) % nk) / nk; }); }
extern "C" SIM_MOD_EXPORT void sim_init(int /*argc*/, char ** /*argv*/, void *ctx) { USE(1); USE(2); USE(3); USE(4); }
virtual void exec() { USE(READ, n); USE(READWRITE, A, y, x, b); forall<simd_exec>(0, n, [=](int i) { forall<simd_exec>(0, i, [=](int j) { ReduceSum<seq_reduce, T> w{-A->at(i, j)}; forall<simd_exec>(0, j, [=](int k) { w += A->at(i, k) * A->at(k, j); }); A->at(i, j) = -w / A->at(j, j); }); forall<simd_exec>(i, n, [=](int j) { ReduceSum<seq_reduce, T> w{-A->at(i, j)}; forall<simd_exec>(0, i, [=](int k) { w += A->at(i, k) * A->at(k, j); }); A->at(i, j) = -w; }); }); forall<simd_exec>(0, n, [=](int i) { ReduceSum<seq_reduce, T> w{-b->at(i)}; forall<simd_exec>(0, i, [=](int j) { w += A->at(i, j) * y->at(j); }); y->at(i) = -w; }); forall<simd_exec>(0, n, [=](int i_) { int i = n - (i_ + 1); ReduceSum<seq_reduce, T> w{-y->at(i)}; forall<simd_exec>(i + 1, n, [=](int j) { w += A->at(i, j) * x->at(j); }); x->at(i) = -w / A->at(i, i); }); }
virtual void init() { USE(READ, n, fn); USE(READWRITE, A, x, y, b); Arr2D<T> *B = new Arr2D<T>{n, n}; forall<simd_exec>(0, n, [=](int i) { x->at(i) = static_cast<T>(0); y->at(i) = static_cast<T>(0); b->at(i) = (i + 1) / fn / static_cast<T>(2.0) + 4; }); forallN<NestedPolicy<ExecList<simd_exec, simd_exec>>>( RangeSegment{0, n}, RangeSegment{0, n}, [=](int i, int j) { A->at(i, j) = (j < i) ? (static_cast<T>(-j % n) / n + 1) : (i == j); }); forallN<NestedPolicy<ExecList<simd_exec, simd_exec>>>( RangeSegment{0, n}, RangeSegment{0, n}, [=](int r, int s) { B->at(r, s) = 0; }); forallN<NestedPolicy<ExecList<simd_exec, simd_exec, simd_exec>>>( RangeSegment{0, n}, RangeSegment{0, n}, RangeSegment{0, n}, [=](int r, int s, int t) { B->at(r, s) += A->at(r, t) * A->at(s, t); }); forallN<NestedPolicy<ExecList<simd_exec, simd_exec>>>( RangeSegment{0, n}, RangeSegment{0, n}, [=](int r, int s) { A->at(r, s) = B->at(r, s); }); delete B; }
void RB_RTF_Generate_Label( FILE *dest_doc, char *name ) { USE( dest_doc ); USE( name ); /* Empty */ }
BOOL WINAPI SetICMProfileW(HDC hdc, LPWSTR pszFileName) { USE(hdc); USE(pszFileName); GdiSetLastError(ERROR_CALL_NOT_IMPLEMENTED); return(FALSE); }
virtual void init() { USE(READ, m, n); USE(READWRITE, data); for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) data->at(i, j) = static_cast<T>(i * j) / m + i; }
/*ARGSUSED*/ void dotelltc(Char **v, struct command *c) { USE(v); USE(c); if (!GotTermCaps) GetTermCaps(); TellTC(); }
BOOL WINAPI GetICMProfileW(HDC hdc, DWORD szBuffer, LPWSTR pBuffer) { USE(hdc); USE(pBuffer); USE(szBuffer); GdiSetLastError(ERROR_CALL_NOT_IMPLEMENTED); return(FALSE); }
virtual void init() { USE(READ, n); USE(READWRITE, A, B); for (int i = 0; i < n; i++) { A->at(i) = (static_cast<T>(i) + 2) / n; B->at(i) = (static_cast<T>(i) + 3) / n; } }
BOOL WINAPI UpdateICMRegKeyW(DWORD Reserved,PWSTR szICMMatcher,PWSTR szFileName,DWORD Command) { USE(Reserved); USE(szICMMatcher); USE(szFileName); USE(Command); GdiSetLastError(ERROR_CALL_NOT_IMPLEMENTED); return(FALSE); }
void RB_RTF_Generate_EndSection( FILE *dest_doc, int depth, char *name ) { USE( dest_doc ); USE( depth ); USE( name ); /* empty */ }
virtual void init() { USE(READ, n, m); USE(READWRITE, A, x); T fn{static_cast<T>(n)}; for (int i = 0; i < n; i++) x->at(i) = 1 + (i / fn); for (int i = 0; i < m; i++) for (int j = 0; j < n; j++) A->at(i, j) = static_cast<T>((i + j) % n) / (5 * m); }
virtual void exec() { USE(READ, m, n, alpha, A); USE(READWRITE, B); for (int i = 0; i < m; i++) for (int j = 0; j < n; j++) { for (int k = i + 1; k < m; k++) B->at(i, j) += A->at(k, i) * B->at(k, j); B->at(i, j) = alpha * B->at(i, j); } }
int main() { Test t; const Test& ct = t; USE(t); USE(ct); }
virtual void init() { USE(READ, n); USE(READWRITE, A, B, x); for (int i = 0; i < n; i++) { x->at(i) = static_cast<T>(i % n) / n; for (int j = 0; j < n; j++) { A->at(i, j) = static_cast<T>((i * j + 1) % n) / n; B->at(i, j) = static_cast<T>((i * j + 2) % n) / n; } } }
virtual void init() { USE(READ, n); USE(READWRITE, seq, table); forall<simd_exec>(0, n, [=](int i) { seq->at(i) = static_cast<base_t>((i + 1) % 4); }); forallN<NestedPolicy<ExecList<simd_exec, simd_exec>>>( RangeSegment{0, n}, RangeSegment{0, n}, [=](int i, int j) { table->at(i, j) = 0; }); }
virtual void exec() { USE(READ, n, tsteps); USE(READWRITE, A, B); for (int t = 0; t < tsteps; t++) { for (int i = 1; i < n - 1; i++) B->at(i) = static_cast<T>(0.33333) * (A->at(i - 1) + A->at(i) + A->at(i + 1)); for (int i = 1; i < n - 1; i++) A->at(i) = static_cast<T>(0.33333) * (B->at(i - 1) + B->at(i) + B->at(i + 1)); } }
virtual void init() { USE(READ, m, n); USE(READWRITE, A, R, Q); for (int i = 0; i < m; i++) for (int j = 0; j < n; j++) { A->at(i, j) = ((static_cast<T>((i * j) % m) / m) * 100) + 10; Q->at(i, j) = static_cast<T>(0.0); } for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) R->at(i, j) = static_cast<T>(0.0); }
virtual void init() { USE(READ, n); USE(READWRITE, u); using init_pol = NestedPolicy<ExecList<omp_parallel_for_exec, simd_exec>, Tile<TileList<tile_fixed<16>, tile_none>>>; forallN<init_pol>( RangeSegment{0, n}, RangeSegment{0, n}, [=](int i, int j) { u->at(i, j) = static_cast<T>(i + n - j) / n; }); }
virtual void exec() { USE(READ, n, m, A, x); USE(READWRITE, y, tmp); for (int i = 0; i < n; i++) y->at(i) = static_cast<T>(0.0); for (int i = 0; i < m; i++) { tmp->at(i) = static_cast<T>(0.0); for (int j = 0; j < n; j++) tmp->at(i) = tmp->at(i) + A->at(i, j) * x->at(j); for (int j = 0; j < n; j++) y->at(j) = y->at(j) + A->at(i, j) * tmp->at(i); } }
virtual void exec() { USE(READ, m, n, alpha, beta, A, B); USE(READWRITE, C); for (int i = 0; i < n; i++) { for (int j = 0; j <= i; j++) C->at(i, j) *= beta; for (int k = 0; k < m; k++) for (int j = 0; j <= i; j++) { C->at(i, j) += A->at(j, k) * alpha * B->at(i, k) + B->at(j, k) * alpha * A->at(i, k); } } }
virtual void exec() { USE(READ, n, alpha, beta, A, B, x); USE(READWRITE, y, tmp); for (int i = 0; i < n; i++) { tmp->at(i) = static_cast<T>(0.0); y->at(i) = static_cast<T>(0.0); for (int j = 0; j < n; j++) { tmp->at(i) = A->at(i, j) * x->at(j) + tmp->at(i); y->at(i) = B->at(i, j) * x->at(j) + y->at(i); } y->at(i) = alpha * tmp->at(i) + beta * y->at(i); } }
virtual void init() { USE(READ, m, n); USE(READWRITE, A, C, B); for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) { A->at(i, j) = static_cast<T>((i * j + 1) % n) / n; B->at(i, j) = static_cast<T>((i * j + 2) % m) / m; } for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) { C->at(i, j) = static_cast<T>((i * j + 3) % n) / m; } }
virtual void init() { USE(READ, m, n); USE(READWRITE, A, B); for (int i = 0; i < m; i++) { for (int j = 0; j < i; j++) { A->at(i, j) = static_cast<T>((i + j) % m) / m; } A->at(i, i) = static_cast<T>(1.0); for (int j = 0; j < n; j++) { B->at(i, j) = static_cast<T>((n + (i - j)) % n) / n; } } }