bool test(accelerator_view &rv) { const int size = 100; vector<int> A(size); vector<s> G(size); vector<int> Gi(size); vector<double> Gd(size); for(int i = 0; i < size; i++) { A[i] = INIT_VALUE; } extent<1> e(size); Concurrency::array<int, 1> aA(e, A.begin(), rv); Concurrency::array<s, 1> aG(e, G.begin(), rv); Concurrency::array<int, 1> aGi(e, Gi.begin(), rv); Concurrency::array<double, 1> aGd(e, Gd.begin(), rv); parallel_for_each(aA.get_extent(), [&](index<1>idx) __GPU { s* volatile ps = &aG[idx]; int * volatile pi1 = &aGi[idx]; double * volatile pd1 = &aGd[idx]; // not allowed here aA[idx] = 1; });
void FsGuiColorDialog::UpdateRGBSliderFromCurrentColor(void) { auto col=GetCurrentColor(); redSlider->SetPosition(col.Rd()); greenSlider->SetPosition(col.Gd()); blueSlider->SetPosition(col.Bd()); }
bool test(accelerator_view &rv) { const int size = 100; vector<int> A(size); vector<s> G(size); vector<int> Gi(size); vector<double> Gd(size); for(int i = 0; i < size; i++) { A[i] = INIT_VALUE; } extent<1> e(size); array<int, 1> aA(e, A.begin(), rv); array<s, 1> aG(e, G.begin(), rv); array<int, 1> aGi(e, Gi.begin(), rv); array<double, 1> aGd(e, Gd.begin(), rv); parallel_for_each(aA.get_extent(), [&](index<1>idx) __GPU { const s o2 = aG[idx]; const s* ps = &o2; ps->i = 1; // not allowed here ps->d = 1; ps->ul = 1; ps->f = 1; const int *pi1 = &aGi[idx]; *pi1 = 2; const double d1 = 1; const double *pd1 = &aGd[idx]; *pd1 = 2.0; aA[idx] = 1; });
void disassembler::Gy(const x86_insn *insn) { if (insn->os_64) Gq(insn); else Gd(insn); }
void mixtureKEpsilon<BasicTurbulenceModel>::correct() { const transportModel& gas = this->transport(); const twoPhaseSystem& fluid = gas.fluid(); // Only solve the mixture turbulence for the gas-phase if (&gas != &fluid.phase1()) { // This is the liquid phase but check the model for the gas-phase // is consistent this->liquidTurbulence(); return; } if (!this->turbulence_) { return; } // Initialise the mixture fields if they have not yet been constructed initMixtureFields(); // Local references to gas-phase properties const surfaceScalarField& phig = this->phi_; const volVectorField& Ug = this->U_; const volScalarField& alphag = this->alpha_; volScalarField& kg = this->k_; volScalarField& epsilong = this->epsilon_; volScalarField& nutg = this->nut_; // Local references to liquid-phase properties mixtureKEpsilon<BasicTurbulenceModel>& liquidTurbulence = this->liquidTurbulence(); const surfaceScalarField& phil = liquidTurbulence.phi_; const volVectorField& Ul = liquidTurbulence.U_; const volScalarField& alphal = liquidTurbulence.alpha_; volScalarField& kl = liquidTurbulence.k_; volScalarField& epsilonl = liquidTurbulence.epsilon_; volScalarField& nutl = liquidTurbulence.nut_; // Local references to mixture properties volScalarField& rhom = rhom_(); volScalarField& km = km_(); volScalarField& epsilonm = epsilonm_(); eddyViscosity<RASModel<BasicTurbulenceModel> >::correct(); // Update the effective mixture density rhom = this->rhom(); // Mixture flux surfaceScalarField phim("phim", mixFlux(phil, phig)); // Mixture velocity divergence volScalarField divUm ( mixU ( fvc::div(fvc::absolute(phil, Ul)), fvc::div(fvc::absolute(phig, Ug)) ) ); tmp<volScalarField> Gc; { tmp<volTensorField> tgradUl = fvc::grad(Ul); Gc = tmp<volScalarField> ( new volScalarField ( this->GName(), nutl*(tgradUl() && dev(twoSymm(tgradUl()))) ) ); tgradUl.clear(); // Update k, epsilon and G at the wall kl.boundaryField().updateCoeffs(); epsilonl.boundaryField().updateCoeffs(); Gc().checkOut(); } tmp<volScalarField> Gd; { tmp<volTensorField> tgradUg = fvc::grad(Ug); Gd = tmp<volScalarField> ( new volScalarField ( this->GName(), nutg*(tgradUg() && dev(twoSymm(tgradUg()))) ) ); tgradUg.clear(); // Update k, epsilon and G at the wall kg.boundaryField().updateCoeffs(); epsilong.boundaryField().updateCoeffs(); Gd().checkOut(); } // Mixture turbulence generation volScalarField Gm(mix(Gc, Gd)); // Mixture turbulence viscosity volScalarField nutm(mixU(nutl, nutg)); // Update the mixture k and epsilon boundary conditions km == mix(kl, kg); bound(km, this->kMin_); epsilonm == mix(epsilonl, epsilong); bound(epsilonm, this->epsilonMin_); // Dissipation equation tmp<fvScalarMatrix> epsEqn ( fvm::ddt(rhom, epsilonm) + fvm::div(phim, epsilonm) - fvm::Sp(fvc::ddt(rhom) + fvc::div(phim), epsilonm) - fvm::laplacian(DepsilonEff(rhom*nutm), epsilonm) == C1_*rhom*Gm*epsilonm/km - fvm::SuSp(((2.0/3.0)*C1_)*rhom*divUm, epsilonm) - fvm::Sp(C2_*rhom*epsilonm/km, epsilonm) + epsilonSource() ); epsEqn().relax(); epsEqn().boundaryManipulate(epsilonm.boundaryField()); solve(epsEqn); bound(epsilonm, this->epsilonMin_); // Turbulent kinetic energy equation tmp<fvScalarMatrix> kmEqn ( fvm::ddt(rhom, km) + fvm::div(phim, km) - fvm::Sp(fvc::ddt(rhom) + fvc::div(phim), km) - fvm::laplacian(DkEff(rhom*nutm), km) == rhom*Gm - fvm::SuSp((2.0/3.0)*rhom*divUm, km) - fvm::Sp(rhom*epsilonm/km, km) + kSource() ); kmEqn().relax(); solve(kmEqn); bound(km, this->kMin_); km.correctBoundaryConditions(); volScalarField Cc2(rhom/(alphal*rholEff() + alphag*rhogEff()*Ct2_())); kl = Cc2*km; kl.correctBoundaryConditions(); epsilonl = Cc2*epsilonm; epsilonl.correctBoundaryConditions(); liquidTurbulence.correctNut(); Ct2_() = Ct2(); kg = Ct2_()*kl; kg.correctBoundaryConditions(); epsilong = Ct2_()*epsilonl; epsilong.correctBoundaryConditions(); nutg = Ct2_()*(liquidTurbulence.nu()/this->nu())*nutl; }