diff --git a/src/modules/Bond2010_gpu.cu.h b/src/modules/Bond2010_gpu.cu.h index 7a58455..fdbd7ce 100644 --- a/src/modules/Bond2010_gpu.cu.h +++ b/src/modules/Bond2010_gpu.cu.h @@ -63,7 +63,7 @@ namespace Bond2010 // #if !__CUDACC__ && !BUILD_FOR_CPU - DECLARE_KERNEL(os_Bond2010_kernel(otable_ks ks, gpu_rng_t rng, cint_t::gpu_t comp, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t vcyl)); + DECLARE_KERNEL(os_Bond2010_kernel(otable_ks ks, gpu_rng_t rng, cint_t::gpu_t comp, cint_t::gpu_t hidden, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t vcyl)); #else // #if !__CUDACC__ && !BUILD_FOR_CPU @@ -166,10 +166,11 @@ namespace Bond2010 os_Bond2010_kernel( otable_ks ks, gpu_rng_t rng, cint_t::gpu_t comp, + cint_t::gpu_t hidden, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t vcyl), os_Bond2010_kernel, - (ks, rng, comp, XYZ, vcyl) + (ks, rng, comp, hidden, XYZ, vcyl) ) { using namespace Bond2010; @@ -178,6 +179,8 @@ namespace Bond2010 rng.load(threadID()); for(int row=ks.row_begin(); row < ks.row_end(); row++) { + if(hidden(row)) { continue; } + // fetch prerequisites const int cmp = comp(row); diff --git a/src/modules/Bond2010_host.cpp b/src/modules/Bond2010_host.cpp index d4c0ad8..635ae2a 100644 --- a/src/modules/Bond2010_host.cpp +++ b/src/modules/Bond2010_host.cpp @@ -75,6 +75,7 @@ size_t os_Bond2010::process(otable &in, size_t begin, size_t end, rng_t &rng) // fetch prerequisites cint_t &comp = in.col("comp"); + cint_t &hidden= in.col("hidden"); cfloat_t &XYZ = in.col("XYZ"); cfloat_t &vcyl = in.col("vcyl"); @@ -84,7 +85,7 @@ size_t os_Bond2010::process(otable &in, size_t begin, size_t end, rng_t &rng) cuxUploadConst("os_Bond2010_par", static_cast(*this)); // for GPU execution os_Bond2010_par = static_cast(*this); // for CPU execution - CALL_KERNEL(os_Bond2010_kernel, otable_ks(begin, end), rng, comp, XYZ, vcyl); + CALL_KERNEL(os_Bond2010_kernel, otable_ks(begin, end), rng, comp, hidden, XYZ, vcyl); return nextlink->process(in, begin, end, rng); } diff --git a/src/modules/GaussianFeH_gpu.cu.h b/src/modules/GaussianFeH_gpu.cu.h index 348a35f..86066a7 100644 --- a/src/modules/GaussianFeH_gpu.cu.h +++ b/src/modules/GaussianFeH_gpu.cu.h @@ -30,17 +30,19 @@ KERNEL( ks, 3*4, os_GaussianFeH_kernel( otable_ks ks, bit_map applyToComponents, float mean, float sigma, gpu_rng_t rng, - cint_t::gpu_t comp, + cint_t::gpu_t comp, cint_t::gpu_t hidden, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t FeH), os_GaussianFeH_kernel, - (ks, applyToComponents, mean, sigma, rng, comp, XYZ, FeH) + (ks, applyToComponents, mean, sigma, rng, comp, hidden, XYZ, FeH) ) { uint32_t tid = threadID(); rng.load(tid); for(uint32_t row = ks.row_begin(); row < ks.row_end(); row++) { + if(hidden(row)) { continue; } + int cmp = comp(row); if(!applyToComponents.isset(cmp)) { continue; } diff --git a/src/modules/GaussianFeH_host.cpp b/src/modules/GaussianFeH_host.cpp index 3aa652d..8676a07 100644 --- a/src/modules/GaussianFeH_host.cpp +++ b/src/modules/GaussianFeH_host.cpp @@ -49,7 +49,7 @@ class os_GaussianFeH : public osink extern "C" opipeline_stage *create_module_gaussianfeh() { return new os_GaussianFeH(); } // Factory; called by opipeline_stage::create() DECLARE_KERNEL(os_GaussianFeH_kernel(otable_ks ks, bit_map applyToComponents, float mean, float sigma, gpu_rng_t rng, - cint_t::gpu_t comp, + cint_t::gpu_t comp, cint_t::gpu_t hidden, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t FeH)); @@ -62,10 +62,11 @@ size_t os_GaussianFeH::process(otable &in, size_t begin, size_t end, rng_t &rng) // fetch prerequisites cint_t &comp = in.col("comp"); + cint_t &hidden= in.col("hidden"); cfloat_t &XYZ = in.col("XYZ"); cfloat_t &FeH = in.col("FeH"); - CALL_KERNEL(os_GaussianFeH_kernel, otable_ks(begin, end), applyToComponents, mean, sigma, rng, comp, XYZ, FeH); + CALL_KERNEL(os_GaussianFeH_kernel, otable_ks(begin, end), applyToComponents, mean, sigma, rng, comp, hidden, XYZ, FeH); return nextlink->process(in, begin, end, rng); } diff --git a/src/modules/fixedFeH_gpu.cu.h b/src/modules/fixedFeH_gpu.cu.h index fe61fc8..61ca74f 100644 --- a/src/modules/fixedFeH_gpu.cu.h +++ b/src/modules/fixedFeH_gpu.cu.h @@ -27,19 +27,21 @@ #if !__CUDACC__ && !BUILD_FOR_CPU - DECLARE_KERNEL(os_fixedFeH_kernel(otable_ks ks, bit_map applyToComponents, float fixedFeH, cint_t::gpu_t comp, cfloat_t::gpu_t FeH)); + DECLARE_KERNEL(os_fixedFeH_kernel(otable_ks ks, bit_map applyToComponents, float fixedFeH, cint_t::gpu_t comp, cint_t::gpu_t hidden, cfloat_t::gpu_t FeH)); #else KERNEL( ks, 0, - os_fixedFeH_kernel(otable_ks ks, bit_map applyToComponents, float fixedFeH, cint_t::gpu_t comp, cfloat_t::gpu_t FeH), + os_fixedFeH_kernel(otable_ks ks, bit_map applyToComponents, float fixedFeH, cint_t::gpu_t comp, cint_t::gpu_t hidden, cfloat_t::gpu_t FeH), os_fixedFeH_kernel, - (ks, applyToComponents, fixedFeH, comp, FeH) + (ks, applyToComponents, fixedFeH, comp, hidden, FeH) ) { for(uint32_t row = ks.row_begin(); row < ks.row_end(); row++) { + if(hidden(row)) { continue; } + int cmp = comp(row); if(!applyToComponents.isset(cmp)) { continue; } diff --git a/src/modules/fixedFeH_host.cpp b/src/modules/fixedFeH_host.cpp index 2edd803..af06e89 100644 --- a/src/modules/fixedFeH_host.cpp +++ b/src/modules/fixedFeH_host.cpp @@ -53,8 +53,9 @@ size_t os_fixedFeH::process(otable &in, size_t begin, size_t end, rng_t &rng) // - all stars are main sequence cfloat_t &FeH = in.col("FeH"); cint_t &comp = in.col("comp"); + cint_t &hidden = in.col("hidden"); - CALL_KERNEL(os_fixedFeH_kernel, otable_ks(begin, end), applyToComponents, fixedFeH, comp, FeH); + CALL_KERNEL(os_fixedFeH_kernel, otable_ks(begin, end), applyToComponents, fixedFeH, comp, hidden, FeH); return nextlink->process(in, begin, end, rng); } diff --git a/src/modules/gal2other_gpu.cu.h b/src/modules/gal2other_gpu.cu.h index 9270dba..f022dea 100644 --- a/src/modules/gal2other_gpu.cu.h +++ b/src/modules/gal2other_gpu.cu.h @@ -32,7 +32,7 @@ // #if !__CUDACC__ && !BUILD_FOR_CPU - DECLARE_KERNEL(os_gal2other_kernel(otable_ks ks, int coordsys, cdouble_t::gpu_t lb0, cdouble_t::gpu_t out)); + DECLARE_KERNEL(os_gal2other_kernel(otable_ks ks, int coordsys, cint_t::gpu_t hidden, cdouble_t::gpu_t lb0, cdouble_t::gpu_t out)); #else // #if !__CUDACC__ && !BUILD_FOR_CPU @@ -61,15 +61,17 @@ KERNEL( ks, 0, - os_gal2other_kernel(otable_ks ks, int coordsys, cdouble_t::gpu_t lb0, cdouble_t::gpu_t out), + os_gal2other_kernel(otable_ks ks, int coordsys, cint_t::gpu_t hidden, cdouble_t::gpu_t lb0, cdouble_t::gpu_t out), os_gal2other_kernel, - (ks, coordsys, lb0, out) + (ks, coordsys, hidden, lb0, out) ) { using namespace peyton; // for mathematical constants for(uint32_t row = ks.row_begin(); row < ks.row_end(); row++) { + if(hidden(row)) { continue; } + double2 lb, ret; // convert to radians diff --git a/src/modules/gal2other_host.cpp b/src/modules/gal2other_host.cpp index 9a8037f..6098eac 100644 --- a/src/modules/gal2other_host.cpp +++ b/src/modules/gal2other_host.cpp @@ -54,11 +54,12 @@ extern "C" opipeline_stage *create_module_gal2other() { return new os_gal2other( size_t os_gal2other::process(otable &in, size_t begin, size_t end, rng_t &rng) { cdouble_t &lb = in.col("lb"); + cint_t &hidden = in.col("hidden"); if(coordsys == EQU) { cdouble_t &out = in.col("radec"); - CALL_KERNEL(os_gal2other_kernel, otable_ks(begin, end), coordsys, lb, out); + CALL_KERNEL(os_gal2other_kernel, otable_ks(begin, end), coordsys, hidden, lb, out); } return nextlink->process(in, begin, end, rng); diff --git a/src/modules/kinTMIII_gpu.cu.h b/src/modules/kinTMIII_gpu.cu.h index c397985..ab77ab6 100644 --- a/src/modules/kinTMIII_gpu.cu.h +++ b/src/modules/kinTMIII_gpu.cu.h @@ -66,7 +66,7 @@ namespace kinTMIII { // #if !__CUDACC__ && !BUILD_FOR_CPU - DECLARE_KERNEL(os_kinTMIII_kernel(otable_ks ks, gpu_rng_t rng, cint_t::gpu_t comp, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t vcyl)); + DECLARE_KERNEL(os_kinTMIII_kernel(otable_ks ks, gpu_rng_t rng, cint_t::gpu_t comp, cint_t::gpu_t hidden, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t vcyl)); #else // #if !__CUDACC__ && !BUILD_FOR_CPU @@ -172,11 +172,11 @@ namespace kinTMIII ks, 3*4, os_kinTMIII_kernel( otable_ks ks, gpu_rng_t rng, - cint_t::gpu_t comp, + cint_t::gpu_t comp, cint_t::gpu_t hidden, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t vcyl), os_kinTMIII_kernel, - (ks, rng, comp, XYZ, vcyl) + (ks, rng, comp, hidden, XYZ, vcyl) ) { using namespace kinTMIII; @@ -208,6 +208,8 @@ namespace kinTMIII uint32_t tid = threadID(); for(int row=ks.row_begin(); row < ks.row_end(); row++) { + if(hidden(row)) { continue; } + // fetch prerequisites const int cmp = comp(row); float X = par.Rg - XYZ(row, 0); diff --git a/src/modules/kinTMIII_host.cpp b/src/modules/kinTMIII_host.cpp index f3cf597..eee37ef 100644 --- a/src/modules/kinTMIII_host.cpp +++ b/src/modules/kinTMIII_host.cpp @@ -74,6 +74,7 @@ size_t os_kinTMIII::process(otable &in, size_t begin, size_t end, rng_t &rng) // fetch prerequisites cint_t &comp = in.col("comp"); + cint_t &hidden = in.col("hidden"); cfloat_t &XYZ = in.col("XYZ"); cfloat_t &vcyl = in.col("vcyl"); @@ -83,7 +84,7 @@ size_t os_kinTMIII::process(otable &in, size_t begin, size_t end, rng_t &rng) cuxUploadConst("os_kinTMIII_par", static_cast(*this)); // for GPU execution os_kinTMIII_par = static_cast(*this); // for CPU execution - CALL_KERNEL(os_kinTMIII_kernel, otable_ks(begin, end), rng, comp, XYZ, vcyl); + CALL_KERNEL(os_kinTMIII_kernel, otable_ks(begin, end), rng, comp, hidden, XYZ, vcyl); return nextlink->process(in, begin, end, rng); } diff --git a/src/modules/photometricErrors_host.cpp b/src/modules/photometricErrors_host.cpp index 83c9434..1c5e028 100644 --- a/src/modules/photometricErrors_host.cpp +++ b/src/modules/photometricErrors_host.cpp @@ -112,6 +112,7 @@ extern "C" opipeline_stage *create_module_modelphotoerrors() { return new os_mod size_t os_photometricErrors::process(otable &in, size_t begin, size_t end, rng_t &rng) { // mix-in gaussian error, with sigma drawn from preloaded splines + cint_t &hidden = in.col("hidden"); FOREACH(columnsToTransform) { cfloat_t::host_t magObs = in.col(i->obsBandset); @@ -120,6 +121,7 @@ size_t os_photometricErrors::process(otable &in, size_t begin, size_t end, rng_t for(size_t row=begin; row <= end; row++) { + if(hidden(row)) { continue; } float mag = magTrue(row, bandIdx); magObs(row, bandIdx) = mag + rng.gaussian(i->sigma(mag)); } diff --git a/src/modules/photometry.h b/src/modules/photometry.h index 8bebb3c..bcfc4f1 100644 --- a/src/modules/photometry.h +++ b/src/modules/photometry.h @@ -34,7 +34,7 @@ struct ALIGN(16) os_photometry_data #if !__CUDACC__ && !BUILD_FOR_CPU - DECLARE_KERNEL(os_photometry_kernel(otable_ks ks, bit_map applyToComponents, gcfloat_t Am, gcint_t flags, gcfloat_t DM, gcfloat_t Mr, int nabsmag, gcfloat_t mags, gcfloat_t FeH, gcint_t comp)); + DECLARE_KERNEL(os_photometry_kernel(otable_ks ks, bit_map applyToComponents, gcfloat_t Am, gcint_t flags, gcfloat_t DM, gcfloat_t Mr, int nabsmag, gcfloat_t mags, gcfloat_t FeH, gcint_t comp, gcint_t hidden)); // Textures with "isochrones" (note that we're assuming a // single-age population here; no actual dependence on age) diff --git a/src/modules/photometry_gpu.cu.h b/src/modules/photometry_gpu.cu.h index dd000c7..a4f19bc 100644 --- a/src/modules/photometry_gpu.cu.h +++ b/src/modules/photometry_gpu.cu.h @@ -86,9 +86,9 @@ unsigned int __brev(unsigned int a) KERNEL( ks, 0, - os_photometry_kernel(otable_ks ks, bit_map applyToComponents, gcfloat_t Am, gcint_t flags, gcfloat_t DM, gcfloat_t Mr, int nabsmag, gcfloat_t mags, gcfloat_t FeH, gcint_t comp), + os_photometry_kernel(otable_ks ks, bit_map applyToComponents, gcfloat_t Am, gcint_t flags, gcfloat_t DM, gcfloat_t Mr, int nabsmag, gcfloat_t mags, gcfloat_t FeH, gcint_t comp, gcint_t hidden), os_photometry_kernel, - (ks, applyToComponents, Am, flags, DM, Mr, nabsmag, mags, FeH, comp) + (ks, applyToComponents, Am, flags, DM, Mr, nabsmag, mags, FeH, comp, hidden) ) { os_photometry_data < = os_photometry_params; @@ -96,6 +96,8 @@ KERNEL( for(uint32_t row = ks.row_begin(); row < ks.row_end(); row++) { + if(hidden(row)) { continue; } + // should we process this star (based on the galactic model component it belongs to)? int cmp = comp(row); if(!applyToComponents.isset(cmp)) { continue; } diff --git a/src/modules/photometry_host.cpp b/src/modules/photometry_host.cpp index a2edcc6..4d17c74 100644 --- a/src/modules/photometry_host.cpp +++ b/src/modules/photometry_host.cpp @@ -363,6 +363,7 @@ extern os_photometry_data os_photometry_params; size_t os_photometry::process(otable &in, size_t begin, size_t end, rng_t &rng) { cint_t &comp = in.col("comp"); + cint_t &hidden = in.col("hidden"); cint_t &flags = in.col(photoFlagsName); cfloat_t &DM = in.col("DM"); cfloat_t &mags = in.col(bandset2); @@ -387,7 +388,7 @@ size_t os_photometry::process(otable &in, size_t begin, size_t end, rng_t &rng) cuxUploadConst("os_photometry_params", static_cast(*this)); // for GPU execution os_photometry_params = static_cast(*this); // for CPU execution - CALL_KERNEL(os_photometry_kernel, otable_ks(begin, end, -1, sizeof(float)*ncolors), applyToComponents, Am, flags, DM, Mr, Mr.width(), mags, FeH, comp); + CALL_KERNEL(os_photometry_kernel, otable_ks(begin, end, -1, sizeof(float)*ncolors), applyToComponents, Am, flags, DM, Mr, Mr.width(), mags, FeH, comp, hidden); } return nextlink->process(in, begin, end, rng); diff --git a/src/modules/unresolvedMultiples_gpu.cu.h b/src/modules/unresolvedMultiples_gpu.cu.h index fef1c78..c333df2 100644 --- a/src/modules/unresolvedMultiples_gpu.cu.h +++ b/src/modules/unresolvedMultiples_gpu.cu.h @@ -37,7 +37,7 @@ namespace multiplesAlgorithms #if !__CUDACC__ && !BUILD_FOR_CPU - DECLARE_KERNEL(os_unresolvedMultiples_kernel(otable_ks ks, bit_map applyToComponents, gpu_rng_t rng, int nabsmag, cfloat_t::gpu_t M, cfloat_t::gpu_t Msys, cint_t::gpu_t ncomp, cint_t::gpu_t comp, multiplesAlgorithms::algo algo)); + DECLARE_KERNEL(os_unresolvedMultiples_kernel(otable_ks ks, bit_map applyToComponents, gpu_rng_t rng, int nabsmag, cfloat_t::gpu_t M, cfloat_t::gpu_t Msys, cint_t::gpu_t ncomp, cint_t::gpu_t comp, cint_t::gpu_t hidden, multiplesAlgorithms::algo algo)); #else @@ -79,9 +79,9 @@ namespace multiplesAlgorithms KERNEL( ks, 3*4, - os_unresolvedMultiples_kernel(otable_ks ks, bit_map applyToComponents, gpu_rng_t rng, int nabsmag, cfloat_t::gpu_t M, cfloat_t::gpu_t Msys, cint_t::gpu_t ncomp, cint_t::gpu_t comp, multiplesAlgorithms::algo algo), + os_unresolvedMultiples_kernel(otable_ks ks, bit_map applyToComponents, gpu_rng_t rng, int nabsmag, cfloat_t::gpu_t M, cfloat_t::gpu_t Msys, cint_t::gpu_t ncomp, cint_t::gpu_t comp, cint_t::gpu_t hidden, multiplesAlgorithms::algo algo), os_unresolvedMultiples_kernel, - (ks, applyToComponents, rng, nabsmag, M, Msys, ncomp, comp, algo) + (ks, applyToComponents, rng, nabsmag, M, Msys, ncomp, comp, hidden, algo) ) { /* @@ -92,6 +92,8 @@ namespace multiplesAlgorithms rng.load(threadID()); for(uint32_t row = ks.row_begin(); row < ks.row_end(); row++) { + if(hidden(row)) { continue; } + int cmp = comp(row); if(!applyToComponents.isset(cmp)) { continue; } diff --git a/src/modules/unresolvedMultiples_host.cpp b/src/modules/unresolvedMultiples_host.cpp index f344855..556c439 100644 --- a/src/modules/unresolvedMultiples_host.cpp +++ b/src/modules/unresolvedMultiples_host.cpp @@ -89,6 +89,7 @@ size_t os_unresolvedMultiples::process(otable &in, size_t begin, size_t end, rng // - galactocentric XYZ coordinates exist in input // - all stars are main sequence cint_t &comp = in.col("comp"); + cint_t &hidden = in.col("hidden"); cfloat_t &M = in.col("absmag"); cfloat_t &Msys = in.col(absmagSys); cint_t &ncomp = in.col(absmagSys+"Ncomp"); @@ -99,7 +100,7 @@ size_t os_unresolvedMultiples::process(otable &in, size_t begin, size_t end, rng t2(::cumLF, cumLF), t3(::invCumLF, invCumLF); - CALL_KERNEL(os_unresolvedMultiples_kernel, otable_ks(begin, end), applyToComponents, rng, Msys.width(), M, Msys, ncomp, comp, algo); + CALL_KERNEL(os_unresolvedMultiples_kernel, otable_ks(begin, end), applyToComponents, rng, Msys.width(), M, Msys, ncomp, comp, hidden, algo); } return nextlink->process(in, begin, end, rng); diff --git a/src/modules/vel2pm_gpu.cu.h b/src/modules/vel2pm_gpu.cu.h index 2da1ce4..d444d66 100644 --- a/src/modules/vel2pm_gpu.cu.h +++ b/src/modules/vel2pm_gpu.cu.h @@ -45,7 +45,8 @@ struct os_vel2pm_data cdouble_t::gpu_t lb0, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t vcyl, - cfloat_t::gpu_t pmlb + cfloat_t::gpu_t pmlb, + cint_t::gpu_t hidden ) ); @@ -256,14 +257,17 @@ struct os_vel2pm_data cdouble_t::gpu_t lb0, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t vcyl, - cfloat_t::gpu_t pmout), + cfloat_t::gpu_t pmout, + cint_t::gpu_t hidden), os_vel2pm_kernel, - (ks, par, rng, lb0, XYZ, vcyl, pmout) + (ks, par, rng, lb0, XYZ, vcyl, pmout, hidden) ) { for(uint32_t row=ks.row_begin(); row < ks.row_end(); row++) { + if(hidden(row)) { continue; } + // fetch prerequisites // NOTE: Single precision should be sufficient here for (l,b) float l = radf(lb0(row, 0)); diff --git a/src/modules/vel2pm_host.cpp b/src/modules/vel2pm_host.cpp index c13050a..7259c2b 100644 --- a/src/modules/vel2pm_host.cpp +++ b/src/modules/vel2pm_host.cpp @@ -67,8 +67,9 @@ size_t os_vel2pm::process(otable &in, size_t begin, size_t end, rng_t &rng) cfloat_t &XYZ = in.col("XYZ"); cfloat_t &vcyl = in.col("vcyl"); cfloat_t &pmlb = in.col(output_col_name); + cint_t &hidden = in.col("hidden"); - CALL_KERNEL(os_vel2pm_kernel, otable_ks(begin, end), *this, rng, lb0, XYZ, vcyl,pmlb); + CALL_KERNEL(os_vel2pm_kernel, otable_ks(begin, end), *this, rng, lb0, XYZ, vcyl, pmlb, hidden); return nextlink->process(in, begin, end, rng); }