[Libclc-dev] [PATCH 2/4] spirv: remove step/smoothstep apis not defined for SPIR-V

Jan Vesely via Libclc-dev libclc-dev at lists.llvm.org
Fri Oct 11 20:15:20 PDT 2019


On Sat, 2019-10-12 at 08:13 +1000, David Airlie via Libclc-dev wrote:
> On Sat, Oct 12, 2019 at 7:17 AM Jan Vesely <jan.vesely at rutgers.edu> wrote:
> > On Fri, 2019-09-27 at 10:59 +1000, Dave Airlie via Libclc-dev wrote:
> > > ---
> > >  libclc/generic/lib/common/smoothstep.cl | 3 ++-
> > >  libclc/generic/lib/common/step.cl       | 3 ++-
> > >  2 files changed, 4 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/libclc/generic/lib/common/smoothstep.cl b/libclc/generic/lib/common/smoothstep.cl
> > > index 68d1a13ab39..9ff41e13291 100644
> > > --- a/libclc/generic/lib/common/smoothstep.cl
> > > +++ b/libclc/generic/lib/common/smoothstep.cl
> > > @@ -46,10 +46,11 @@ SMOOTH_STEP_DEF(double, double, SMOOTH_STEP_IMPL_D);
> > > 
> > >  _CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, smoothstep, double, double, double);
> > > 
> > > +#ifndef CLC_SPIRV // SPIRV doesn't define these
> > >  SMOOTH_STEP_DEF(float, double, SMOOTH_STEP_IMPL_D);
> > >  SMOOTH_STEP_DEF(double, float, SMOOTH_STEP_IMPL_D);
> > > 
> > >  _CLC_V_S_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, smoothstep, float, float, double);
> > >  _CLC_V_S_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, smoothstep, double, double, float);
> > > -
> > > +#endif
> > >  #endif
> > > diff --git a/libclc/generic/lib/common/step.cl b/libclc/generic/lib/common/step.cl
> > > index 4b022f1316c..3ceec7b8be3 100644
> > > --- a/libclc/generic/lib/common/step.cl
> > > +++ b/libclc/generic/lib/common/step.cl
> > > @@ -45,10 +45,11 @@ STEP_DEF(double, double);
> > >  _CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, step, double, double);
> > >  _CLC_V_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, step, double, double);
> > > 
> > > +#ifndef CLC_SPIRV
> > >  STEP_DEF(float, double);
> > >  STEP_DEF(double, float);
> > > 
> > >  _CLC_V_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, step, float, double);
> > >  _CLC_V_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, step, double, float);
> > > -
> > > +#endif
> > >  #endif
> > Is it illegal to call step/smoothstep when targetting SPIR-V? or do
> > the headers implement it as a macro?
> > either way it'd be preferable to follow the existing overload
> > mechanism rather than adding ifdefs across the sources (more in
> > reponse to the cmake changes).
> 
> the SPIR-V spec doesn't define step/smoothstep with those interfaces,
> it des define the others that are left unifdef, whether that is a
> mistake or not I'm not sure.
> 
> If the SPIR-V spec never defines those APIs then no code will want to
> access them in the libclc spir-v library.

ah right, you'll be using it SPIR-V runtime library rather than CLC.
makes sense.

> I'm not sure how the exisiting overload mechanism can remove these
> from the library completely, create empty impls?

right, I forgot I didn't port the OVERRIDES mechanism to cmake. ifdefs
are nicer than empty files.

Jan

> 
> Dave.
> 
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/libclc-dev/attachments/20191011/cf3dbbb5/attachment.sig>


More information about the Libclc-dev mailing list