[libclc] 32cf55a - [libclc] Reorganize OpenCL builtins (#140557)

via cfe-commits cfe-commits at lists.llvm.org
Tue May 20 01:51:35 PDT 2025


Author: Fraser Cormack
Date: 2025-05-20T09:51:30+01:00
New Revision: 32cf55aef3f83723616e27d149ea0186d73481b0

URL: https://github.com/llvm/llvm-project/commit/32cf55aef3f83723616e27d149ea0186d73481b0
DIFF: https://github.com/llvm/llvm-project/commit/32cf55aef3f83723616e27d149ea0186d73481b0.diff

LOG: [libclc] Reorganize OpenCL builtins (#140557)

This commits moves all OpenCL builtins under a top-level 'opencl'
directory, akin to how the CLC builtins are organized. This new
structure aims to better convey the separation of the two layers and
that 'CLC' is not a subset of OpenCL or a libclc target.

In doing so this commit moves the location of the 'lib' directory to
match CLC: libclc/generic/lib/ becomes libclc/opencl/lib/generic/. This
allows us to remove some special casing in CMake and ensure a common
directory structure.

It also tries to better communicate that the OpenCL headers are
libclc-specific OpenCL headers and should not be confused with or used
as standard OpenCL headers. It does so by ensuring includes are of the
form <clc/opencl/*>. It might be that we don't specifically need the
libclc OpenCL headers and we simply could use clang's built-in
declarations, but we can revisit that later.

Aside from the code move, there is some code formatting and updating a
couple of OpenCL builtin includes to use the readily available gentype
helpers. This allows us to remove some '.inc' files.

Added: 
    libclc/opencl/include/clc/opencl/as_type.h
    libclc/opencl/include/clc/opencl/async/async_work_group_copy.h
    libclc/opencl/include/clc/opencl/async/async_work_group_copy.inc
    libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.h
    libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.inc
    libclc/opencl/include/clc/opencl/async/prefetch.h
    libclc/opencl/include/clc/opencl/async/prefetch.inc
    libclc/opencl/include/clc/opencl/async/wait_group_events.h
    libclc/opencl/include/clc/opencl/atomic/atom_add.h
    libclc/opencl/include/clc/opencl/atomic/atom_and.h
    libclc/opencl/include/clc/opencl/atomic/atom_cmpxchg.h
    libclc/opencl/include/clc/opencl/atomic/atom_dec.h
    libclc/opencl/include/clc/opencl/atomic/atom_decl_int32.inc
    libclc/opencl/include/clc/opencl/atomic/atom_decl_int64.inc
    libclc/opencl/include/clc/opencl/atomic/atom_inc.h
    libclc/opencl/include/clc/opencl/atomic/atom_max.h
    libclc/opencl/include/clc/opencl/atomic/atom_min.h
    libclc/opencl/include/clc/opencl/atomic/atom_or.h
    libclc/opencl/include/clc/opencl/atomic/atom_sub.h
    libclc/opencl/include/clc/opencl/atomic/atom_xchg.h
    libclc/opencl/include/clc/opencl/atomic/atom_xor.h
    libclc/opencl/include/clc/opencl/atomic/atomic_add.h
    libclc/opencl/include/clc/opencl/atomic/atomic_and.h
    libclc/opencl/include/clc/opencl/atomic/atomic_cmpxchg.h
    libclc/opencl/include/clc/opencl/atomic/atomic_dec.h
    libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc
    libclc/opencl/include/clc/opencl/atomic/atomic_inc.h
    libclc/opencl/include/clc/opencl/atomic/atomic_max.h
    libclc/opencl/include/clc/opencl/atomic/atomic_min.h
    libclc/opencl/include/clc/opencl/atomic/atomic_or.h
    libclc/opencl/include/clc/opencl/atomic/atomic_sub.h
    libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h
    libclc/opencl/include/clc/opencl/atomic/atomic_xor.h
    libclc/opencl/include/clc/opencl/clc.h
    libclc/opencl/include/clc/opencl/common/degrees.h
    libclc/opencl/include/clc/opencl/common/mix.h
    libclc/opencl/include/clc/opencl/common/mix.inc
    libclc/opencl/include/clc/opencl/common/radians.h
    libclc/opencl/include/clc/opencl/common/sign.h
    libclc/opencl/include/clc/opencl/common/smoothstep.h
    libclc/opencl/include/clc/opencl/common/smoothstep.inc
    libclc/opencl/include/clc/opencl/common/step.h
    libclc/opencl/include/clc/opencl/common/step.inc
    libclc/opencl/include/clc/opencl/convert.h
    libclc/opencl/include/clc/opencl/explicit_fence/explicit_memory_fence.h
    libclc/opencl/include/clc/opencl/geometric/cross.h
    libclc/opencl/include/clc/opencl/geometric/distance.h
    libclc/opencl/include/clc/opencl/geometric/dot.h
    libclc/opencl/include/clc/opencl/geometric/fast_distance.h
    libclc/opencl/include/clc/opencl/geometric/fast_length.h
    libclc/opencl/include/clc/opencl/geometric/fast_normalize.h
    libclc/opencl/include/clc/opencl/geometric/length.h
    libclc/opencl/include/clc/opencl/geometric/normalize.h
    libclc/opencl/include/clc/opencl/image/image.h
    libclc/opencl/include/clc/opencl/image/image_defines.h
    libclc/opencl/include/clc/opencl/integer/abs.h
    libclc/opencl/include/clc/opencl/integer/abs.inc
    libclc/opencl/include/clc/opencl/integer/abs_diff.h
    libclc/opencl/include/clc/opencl/integer/abs_diff.inc
    libclc/opencl/include/clc/opencl/integer/add_sat.h
    libclc/opencl/include/clc/opencl/integer/clz.h
    libclc/opencl/include/clc/opencl/integer/ctz.h
    libclc/opencl/include/clc/opencl/integer/hadd.h
    libclc/opencl/include/clc/opencl/integer/mad24.h
    libclc/opencl/include/clc/opencl/integer/mad_hi.h
    libclc/opencl/include/clc/opencl/integer/mad_sat.h
    libclc/opencl/include/clc/opencl/integer/mul24.h
    libclc/opencl/include/clc/opencl/integer/mul_hi.h
    libclc/opencl/include/clc/opencl/integer/popcount.h
    libclc/opencl/include/clc/opencl/integer/rhadd.h
    libclc/opencl/include/clc/opencl/integer/rotate.h
    libclc/opencl/include/clc/opencl/integer/sub_sat.h
    libclc/opencl/include/clc/opencl/integer/upsample.h
    libclc/opencl/include/clc/opencl/math/acos.h
    libclc/opencl/include/clc/opencl/math/acosh.h
    libclc/opencl/include/clc/opencl/math/acospi.h
    libclc/opencl/include/clc/opencl/math/asin.h
    libclc/opencl/include/clc/opencl/math/asinh.h
    libclc/opencl/include/clc/opencl/math/asinpi.h
    libclc/opencl/include/clc/opencl/math/atan.h
    libclc/opencl/include/clc/opencl/math/atan2.h
    libclc/opencl/include/clc/opencl/math/atan2pi.h
    libclc/opencl/include/clc/opencl/math/atanh.h
    libclc/opencl/include/clc/opencl/math/atanpi.h
    libclc/opencl/include/clc/opencl/math/cbrt.h
    libclc/opencl/include/clc/opencl/math/ceil.h
    libclc/opencl/include/clc/opencl/math/copysign.h
    libclc/opencl/include/clc/opencl/math/cos.h
    libclc/opencl/include/clc/opencl/math/cosh.h
    libclc/opencl/include/clc/opencl/math/cospi.h
    libclc/opencl/include/clc/opencl/math/erf.h
    libclc/opencl/include/clc/opencl/math/erfc.h
    libclc/opencl/include/clc/opencl/math/exp.h
    libclc/opencl/include/clc/opencl/math/exp10.h
    libclc/opencl/include/clc/opencl/math/exp2.h
    libclc/opencl/include/clc/opencl/math/expm1.h
    libclc/opencl/include/clc/opencl/math/fabs.h
    libclc/opencl/include/clc/opencl/math/fdim.h
    libclc/opencl/include/clc/opencl/math/floor.h
    libclc/opencl/include/clc/opencl/math/fma.h
    libclc/opencl/include/clc/opencl/math/fmax.h
    libclc/opencl/include/clc/opencl/math/fmin.h
    libclc/opencl/include/clc/opencl/math/fmod.h
    libclc/opencl/include/clc/opencl/math/fract.h
    libclc/opencl/include/clc/opencl/math/frexp.h
    libclc/opencl/include/clc/opencl/math/frexp.inc
    libclc/opencl/include/clc/opencl/math/half_cos.h
    libclc/opencl/include/clc/opencl/math/half_divide.h
    libclc/opencl/include/clc/opencl/math/half_exp.h
    libclc/opencl/include/clc/opencl/math/half_exp10.h
    libclc/opencl/include/clc/opencl/math/half_exp2.h
    libclc/opencl/include/clc/opencl/math/half_log.h
    libclc/opencl/include/clc/opencl/math/half_log10.h
    libclc/opencl/include/clc/opencl/math/half_log2.h
    libclc/opencl/include/clc/opencl/math/half_powr.h
    libclc/opencl/include/clc/opencl/math/half_recip.h
    libclc/opencl/include/clc/opencl/math/half_rsqrt.h
    libclc/opencl/include/clc/opencl/math/half_sin.h
    libclc/opencl/include/clc/opencl/math/half_sqrt.h
    libclc/opencl/include/clc/opencl/math/half_tan.h
    libclc/opencl/include/clc/opencl/math/hypot.h
    libclc/opencl/include/clc/opencl/math/ilogb.h
    libclc/opencl/include/clc/opencl/math/ldexp.h
    libclc/opencl/include/clc/opencl/math/ldexp.inc
    libclc/opencl/include/clc/opencl/math/lgamma.h
    libclc/opencl/include/clc/opencl/math/lgamma_r.h
    libclc/opencl/include/clc/opencl/math/log.h
    libclc/opencl/include/clc/opencl/math/log10.h
    libclc/opencl/include/clc/opencl/math/log1p.h
    libclc/opencl/include/clc/opencl/math/log2.h
    libclc/opencl/include/clc/opencl/math/logb.h
    libclc/opencl/include/clc/opencl/math/mad.h
    libclc/opencl/include/clc/opencl/math/maxmag.h
    libclc/opencl/include/clc/opencl/math/minmag.h
    libclc/opencl/include/clc/opencl/math/modf.h
    libclc/opencl/include/clc/opencl/math/nan.h
    libclc/opencl/include/clc/opencl/math/nan.inc
    libclc/opencl/include/clc/opencl/math/native_cos.h
    libclc/opencl/include/clc/opencl/math/native_divide.h
    libclc/opencl/include/clc/opencl/math/native_exp.h
    libclc/opencl/include/clc/opencl/math/native_exp10.h
    libclc/opencl/include/clc/opencl/math/native_exp2.h
    libclc/opencl/include/clc/opencl/math/native_log.h
    libclc/opencl/include/clc/opencl/math/native_log10.h
    libclc/opencl/include/clc/opencl/math/native_log2.h
    libclc/opencl/include/clc/opencl/math/native_powr.h
    libclc/opencl/include/clc/opencl/math/native_recip.h
    libclc/opencl/include/clc/opencl/math/native_rsqrt.h
    libclc/opencl/include/clc/opencl/math/native_sin.h
    libclc/opencl/include/clc/opencl/math/native_sqrt.h
    libclc/opencl/include/clc/opencl/math/native_tan.h
    libclc/opencl/include/clc/opencl/math/nextafter.h
    libclc/opencl/include/clc/opencl/math/pow.h
    libclc/opencl/include/clc/opencl/math/pown.h
    libclc/opencl/include/clc/opencl/math/powr.h
    libclc/opencl/include/clc/opencl/math/remainder.h
    libclc/opencl/include/clc/opencl/math/remquo.h
    libclc/opencl/include/clc/opencl/math/rint.h
    libclc/opencl/include/clc/opencl/math/rootn.h
    libclc/opencl/include/clc/opencl/math/round.h
    libclc/opencl/include/clc/opencl/math/rsqrt.h
    libclc/opencl/include/clc/opencl/math/sin.h
    libclc/opencl/include/clc/opencl/math/sincos.h
    libclc/opencl/include/clc/opencl/math/sinh.h
    libclc/opencl/include/clc/opencl/math/sinpi.h
    libclc/opencl/include/clc/opencl/math/sqrt.h
    libclc/opencl/include/clc/opencl/math/tan.h
    libclc/opencl/include/clc/opencl/math/tanh.h
    libclc/opencl/include/clc/opencl/math/tanpi.h
    libclc/opencl/include/clc/opencl/math/tgamma.h
    libclc/opencl/include/clc/opencl/math/trunc.h
    libclc/opencl/include/clc/opencl/misc/shuffle.h
    libclc/opencl/include/clc/opencl/misc/shuffle2.h
    libclc/opencl/include/clc/opencl/relational/all.h
    libclc/opencl/include/clc/opencl/relational/any.h
    libclc/opencl/include/clc/opencl/relational/bitselect.h
    libclc/opencl/include/clc/opencl/relational/bitselect.inc
    libclc/opencl/include/clc/opencl/relational/isequal.h
    libclc/opencl/include/clc/opencl/relational/isfinite.h
    libclc/opencl/include/clc/opencl/relational/isgreater.h
    libclc/opencl/include/clc/opencl/relational/isgreaterequal.h
    libclc/opencl/include/clc/opencl/relational/isinf.h
    libclc/opencl/include/clc/opencl/relational/isless.h
    libclc/opencl/include/clc/opencl/relational/islessequal.h
    libclc/opencl/include/clc/opencl/relational/islessgreater.h
    libclc/opencl/include/clc/opencl/relational/isnan.h
    libclc/opencl/include/clc/opencl/relational/isnormal.h
    libclc/opencl/include/clc/opencl/relational/isnotequal.h
    libclc/opencl/include/clc/opencl/relational/isordered.h
    libclc/opencl/include/clc/opencl/relational/isunordered.h
    libclc/opencl/include/clc/opencl/relational/select.h
    libclc/opencl/include/clc/opencl/relational/signbit.h
    libclc/opencl/include/clc/opencl/shared/clamp.h
    libclc/opencl/include/clc/opencl/shared/clamp.inc
    libclc/opencl/include/clc/opencl/shared/max.h
    libclc/opencl/include/clc/opencl/shared/max.inc
    libclc/opencl/include/clc/opencl/shared/min.h
    libclc/opencl/include/clc/opencl/shared/min.inc
    libclc/opencl/include/clc/opencl/shared/vload.h
    libclc/opencl/include/clc/opencl/shared/vstore.h
    libclc/opencl/include/clc/opencl/synchronization/barrier.h
    libclc/opencl/include/clc/opencl/synchronization/cl_mem_fence_flags.h
    libclc/opencl/include/clc/opencl/workitem/get_global_id.h
    libclc/opencl/include/clc/opencl/workitem/get_global_offset.h
    libclc/opencl/include/clc/opencl/workitem/get_global_size.h
    libclc/opencl/include/clc/opencl/workitem/get_group_id.h
    libclc/opencl/include/clc/opencl/workitem/get_local_id.h
    libclc/opencl/include/clc/opencl/workitem/get_local_size.h
    libclc/opencl/include/clc/opencl/workitem/get_num_groups.h
    libclc/opencl/include/clc/opencl/workitem/get_work_dim.h
    libclc/opencl/lib/amdgcn-amdhsa/SOURCES
    libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl
    libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl
    libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl
    libclc/opencl/lib/amdgcn/SOURCES
    libclc/opencl/lib/amdgcn/cl_khr_int64_extended_atomics/minmax_helpers.ll
    libclc/opencl/lib/amdgcn/mem_fence/fence.cl
    libclc/opencl/lib/amdgcn/synchronization/barrier.cl
    libclc/opencl/lib/amdgcn/workitem/get_global_offset.cl
    libclc/opencl/lib/amdgcn/workitem/get_global_size.cl
    libclc/opencl/lib/amdgcn/workitem/get_group_id.cl
    libclc/opencl/lib/amdgcn/workitem/get_local_id.cl
    libclc/opencl/lib/amdgcn/workitem/get_local_size.cl
    libclc/opencl/lib/amdgcn/workitem/get_num_groups.cl
    libclc/opencl/lib/amdgcn/workitem/get_work_dim.cl
    libclc/opencl/lib/clspv/SOURCES
    libclc/opencl/lib/clspv/math/fma.cl
    libclc/opencl/lib/clspv/shared/vstore_half.cl
    libclc/opencl/lib/clspv/shared/vstore_half.inc
    libclc/opencl/lib/clspv/subnormal_config.cl
    libclc/opencl/lib/generic/SOURCES
    libclc/opencl/lib/generic/async/async_work_group_copy.cl
    libclc/opencl/lib/generic/async/async_work_group_copy.inc
    libclc/opencl/lib/generic/async/async_work_group_strided_copy.cl
    libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc
    libclc/opencl/lib/generic/async/prefetch.cl
    libclc/opencl/lib/generic/async/prefetch.inc
    libclc/opencl/lib/generic/async/wait_group_events.cl
    libclc/opencl/lib/generic/atomic/atom_add.cl
    libclc/opencl/lib/generic/atomic/atom_and.cl
    libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl
    libclc/opencl/lib/generic/atomic/atom_dec.cl
    libclc/opencl/lib/generic/atomic/atom_inc.cl
    libclc/opencl/lib/generic/atomic/atom_int32_binary.inc
    libclc/opencl/lib/generic/atomic/atom_max.cl
    libclc/opencl/lib/generic/atomic/atom_min.cl
    libclc/opencl/lib/generic/atomic/atom_or.cl
    libclc/opencl/lib/generic/atomic/atom_sub.cl
    libclc/opencl/lib/generic/atomic/atom_xchg.cl
    libclc/opencl/lib/generic/atomic/atom_xor.cl
    libclc/opencl/lib/generic/atomic/atomic_add.cl
    libclc/opencl/lib/generic/atomic/atomic_and.cl
    libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl
    libclc/opencl/lib/generic/atomic/atomic_dec.cl
    libclc/opencl/lib/generic/atomic/atomic_inc.cl
    libclc/opencl/lib/generic/atomic/atomic_max.cl
    libclc/opencl/lib/generic/atomic/atomic_min.cl
    libclc/opencl/lib/generic/atomic/atomic_or.cl
    libclc/opencl/lib/generic/atomic/atomic_sub.cl
    libclc/opencl/lib/generic/atomic/atomic_xchg.cl
    libclc/opencl/lib/generic/atomic/atomic_xor.cl
    libclc/opencl/lib/generic/common/degrees.cl
    libclc/opencl/lib/generic/common/mix.cl
    libclc/opencl/lib/generic/common/mix.inc
    libclc/opencl/lib/generic/common/radians.cl
    libclc/opencl/lib/generic/common/sign.cl
    libclc/opencl/lib/generic/common/smoothstep.cl
    libclc/opencl/lib/generic/common/step.cl
    libclc/opencl/lib/generic/geometric/cross.cl
    libclc/opencl/lib/generic/geometric/distance.cl
    libclc/opencl/lib/generic/geometric/dot.cl
    libclc/opencl/lib/generic/geometric/fast_distance.cl
    libclc/opencl/lib/generic/geometric/fast_length.cl
    libclc/opencl/lib/generic/geometric/fast_normalize.cl
    libclc/opencl/lib/generic/geometric/fast_normalize.inc
    libclc/opencl/lib/generic/geometric/length.cl
    libclc/opencl/lib/generic/geometric/normalize.cl
    libclc/opencl/lib/generic/integer/abs.cl
    libclc/opencl/lib/generic/integer/abs.inc
    libclc/opencl/lib/generic/integer/abs_diff.cl
    libclc/opencl/lib/generic/integer/abs_diff.inc
    libclc/opencl/lib/generic/integer/add_sat.cl
    libclc/opencl/lib/generic/integer/clz.cl
    libclc/opencl/lib/generic/integer/ctz.cl
    libclc/opencl/lib/generic/integer/hadd.cl
    libclc/opencl/lib/generic/integer/mad24.cl
    libclc/opencl/lib/generic/integer/mad_hi.cl
    libclc/opencl/lib/generic/integer/mad_sat.cl
    libclc/opencl/lib/generic/integer/mul24.cl
    libclc/opencl/lib/generic/integer/mul_hi.cl
    libclc/opencl/lib/generic/integer/popcount.cl
    libclc/opencl/lib/generic/integer/rhadd.cl
    libclc/opencl/lib/generic/integer/rotate.cl
    libclc/opencl/lib/generic/integer/sub_sat.cl
    libclc/opencl/lib/generic/integer/upsample.cl
    libclc/opencl/lib/generic/math/acos.cl
    libclc/opencl/lib/generic/math/acosh.cl
    libclc/opencl/lib/generic/math/acospi.cl
    libclc/opencl/lib/generic/math/asin.cl
    libclc/opencl/lib/generic/math/asinh.cl
    libclc/opencl/lib/generic/math/asinpi.cl
    libclc/opencl/lib/generic/math/atan.cl
    libclc/opencl/lib/generic/math/atan2.cl
    libclc/opencl/lib/generic/math/atan2pi.cl
    libclc/opencl/lib/generic/math/atanh.cl
    libclc/opencl/lib/generic/math/atanpi.cl
    libclc/opencl/lib/generic/math/cbrt.cl
    libclc/opencl/lib/generic/math/ceil.cl
    libclc/opencl/lib/generic/math/copysign.cl
    libclc/opencl/lib/generic/math/cos.cl
    libclc/opencl/lib/generic/math/cosh.cl
    libclc/opencl/lib/generic/math/cospi.cl
    libclc/opencl/lib/generic/math/erf.cl
    libclc/opencl/lib/generic/math/erfc.cl
    libclc/opencl/lib/generic/math/exp.cl
    libclc/opencl/lib/generic/math/exp10.cl
    libclc/opencl/lib/generic/math/exp2.cl
    libclc/opencl/lib/generic/math/expm1.cl
    libclc/opencl/lib/generic/math/fabs.cl
    libclc/opencl/lib/generic/math/fdim.cl
    libclc/opencl/lib/generic/math/floor.cl
    libclc/opencl/lib/generic/math/fma.cl
    libclc/opencl/lib/generic/math/fmax.cl
    libclc/opencl/lib/generic/math/fmax.inc
    libclc/opencl/lib/generic/math/fmin.cl
    libclc/opencl/lib/generic/math/fmin.inc
    libclc/opencl/lib/generic/math/fmod.cl
    libclc/opencl/lib/generic/math/fract.cl
    libclc/opencl/lib/generic/math/frexp.cl
    libclc/opencl/lib/generic/math/half_cos.cl
    libclc/opencl/lib/generic/math/half_divide.cl
    libclc/opencl/lib/generic/math/half_exp.cl
    libclc/opencl/lib/generic/math/half_exp10.cl
    libclc/opencl/lib/generic/math/half_exp2.cl
    libclc/opencl/lib/generic/math/half_log.cl
    libclc/opencl/lib/generic/math/half_log10.cl
    libclc/opencl/lib/generic/math/half_log2.cl
    libclc/opencl/lib/generic/math/half_powr.cl
    libclc/opencl/lib/generic/math/half_recip.cl
    libclc/opencl/lib/generic/math/half_rsqrt.cl
    libclc/opencl/lib/generic/math/half_sin.cl
    libclc/opencl/lib/generic/math/half_sqrt.cl
    libclc/opencl/lib/generic/math/half_tan.cl
    libclc/opencl/lib/generic/math/hypot.cl
    libclc/opencl/lib/generic/math/ilogb.cl
    libclc/opencl/lib/generic/math/ldexp.cl
    libclc/opencl/lib/generic/math/ldexp.inc
    libclc/opencl/lib/generic/math/lgamma.cl
    libclc/opencl/lib/generic/math/lgamma_r.cl
    libclc/opencl/lib/generic/math/log.cl
    libclc/opencl/lib/generic/math/log10.cl
    libclc/opencl/lib/generic/math/log1p.cl
    libclc/opencl/lib/generic/math/log2.cl
    libclc/opencl/lib/generic/math/logb.cl
    libclc/opencl/lib/generic/math/mad.cl
    libclc/opencl/lib/generic/math/maxmag.cl
    libclc/opencl/lib/generic/math/minmag.cl
    libclc/opencl/lib/generic/math/modf.cl
    libclc/opencl/lib/generic/math/nan.cl
    libclc/opencl/lib/generic/math/nan.inc
    libclc/opencl/lib/generic/math/native_cos.cl
    libclc/opencl/lib/generic/math/native_divide.cl
    libclc/opencl/lib/generic/math/native_exp.cl
    libclc/opencl/lib/generic/math/native_exp10.cl
    libclc/opencl/lib/generic/math/native_exp2.cl
    libclc/opencl/lib/generic/math/native_log.cl
    libclc/opencl/lib/generic/math/native_log10.cl
    libclc/opencl/lib/generic/math/native_log2.cl
    libclc/opencl/lib/generic/math/native_powr.cl
    libclc/opencl/lib/generic/math/native_recip.cl
    libclc/opencl/lib/generic/math/native_rsqrt.cl
    libclc/opencl/lib/generic/math/native_sin.cl
    libclc/opencl/lib/generic/math/native_sqrt.cl
    libclc/opencl/lib/generic/math/native_tan.cl
    libclc/opencl/lib/generic/math/nextafter.cl
    libclc/opencl/lib/generic/math/pow.cl
    libclc/opencl/lib/generic/math/pown.cl
    libclc/opencl/lib/generic/math/powr.cl
    libclc/opencl/lib/generic/math/remainder.cl
    libclc/opencl/lib/generic/math/remquo.cl
    libclc/opencl/lib/generic/math/remquo.inc
    libclc/opencl/lib/generic/math/rint.cl
    libclc/opencl/lib/generic/math/rootn.cl
    libclc/opencl/lib/generic/math/round.cl
    libclc/opencl/lib/generic/math/rsqrt.cl
    libclc/opencl/lib/generic/math/sin.cl
    libclc/opencl/lib/generic/math/sincos.cl
    libclc/opencl/lib/generic/math/sinh.cl
    libclc/opencl/lib/generic/math/sinpi.cl
    libclc/opencl/lib/generic/math/sqrt.cl
    libclc/opencl/lib/generic/math/tan.cl
    libclc/opencl/lib/generic/math/tanh.cl
    libclc/opencl/lib/generic/math/tanpi.cl
    libclc/opencl/lib/generic/math/tgamma.cl
    libclc/opencl/lib/generic/math/trunc.cl
    libclc/opencl/lib/generic/misc/shuffle.cl
    libclc/opencl/lib/generic/misc/shuffle2.cl
    libclc/opencl/lib/generic/relational/all.cl
    libclc/opencl/lib/generic/relational/any.cl
    libclc/opencl/lib/generic/relational/binary_def.inc
    libclc/opencl/lib/generic/relational/bitselect.cl
    libclc/opencl/lib/generic/relational/bitselect.inc
    libclc/opencl/lib/generic/relational/isequal.cl
    libclc/opencl/lib/generic/relational/isfinite.cl
    libclc/opencl/lib/generic/relational/isgreater.cl
    libclc/opencl/lib/generic/relational/isgreaterequal.cl
    libclc/opencl/lib/generic/relational/isinf.cl
    libclc/opencl/lib/generic/relational/isless.cl
    libclc/opencl/lib/generic/relational/islessequal.cl
    libclc/opencl/lib/generic/relational/islessgreater.cl
    libclc/opencl/lib/generic/relational/isnan.cl
    libclc/opencl/lib/generic/relational/isnormal.cl
    libclc/opencl/lib/generic/relational/isnotequal.cl
    libclc/opencl/lib/generic/relational/isordered.cl
    libclc/opencl/lib/generic/relational/isunordered.cl
    libclc/opencl/lib/generic/relational/select.cl
    libclc/opencl/lib/generic/relational/signbit.cl
    libclc/opencl/lib/generic/relational/unary_def.inc
    libclc/opencl/lib/generic/shared/clamp.cl
    libclc/opencl/lib/generic/shared/clamp.inc
    libclc/opencl/lib/generic/shared/max.cl
    libclc/opencl/lib/generic/shared/max.inc
    libclc/opencl/lib/generic/shared/min.cl
    libclc/opencl/lib/generic/shared/min.inc
    libclc/opencl/lib/generic/shared/vload.cl
    libclc/opencl/lib/generic/shared/vload_half.inc
    libclc/opencl/lib/generic/shared/vstore.cl
    libclc/opencl/lib/generic/shared/vstore_half.inc
    libclc/opencl/lib/generic/subnormal_config.cl
    libclc/opencl/lib/generic/subnormal_disable.ll
    libclc/opencl/lib/generic/subnormal_helper_func.ll
    libclc/opencl/lib/generic/subnormal_use_default.ll
    libclc/opencl/lib/generic/workitem/get_global_id.cl
    libclc/opencl/lib/generic/workitem/get_global_size.cl
    libclc/opencl/lib/ptx-nvidiacl/SOURCES
    libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl
    libclc/opencl/lib/ptx-nvidiacl/synchronization/barrier.cl
    libclc/opencl/lib/ptx-nvidiacl/workitem/get_global_id.cl
    libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl
    libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl
    libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl
    libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl
    libclc/opencl/lib/r600/SOURCES
    libclc/opencl/lib/r600/SOURCES_3.9
    libclc/opencl/lib/r600/image/get_image_attributes_impl.ll
    libclc/opencl/lib/r600/image/get_image_channel_data_type.cl
    libclc/opencl/lib/r600/image/get_image_channel_order.cl
    libclc/opencl/lib/r600/image/get_image_depth.cl
    libclc/opencl/lib/r600/image/get_image_dim.cl
    libclc/opencl/lib/r600/image/get_image_height.cl
    libclc/opencl/lib/r600/image/get_image_width.cl
    libclc/opencl/lib/r600/image/read_image_impl.ll
    libclc/opencl/lib/r600/image/read_imagef.cl
    libclc/opencl/lib/r600/image/read_imagei.cl
    libclc/opencl/lib/r600/image/read_imageui.cl
    libclc/opencl/lib/r600/image/write_image_impl.ll
    libclc/opencl/lib/r600/image/write_imagef.cl
    libclc/opencl/lib/r600/image/write_imagei.cl
    libclc/opencl/lib/r600/image/write_imageui.cl
    libclc/opencl/lib/r600/synchronization/barrier.cl
    libclc/opencl/lib/r600/workitem/get_global_offset.cl
    libclc/opencl/lib/r600/workitem/get_global_size.cl
    libclc/opencl/lib/r600/workitem/get_group_id.cl
    libclc/opencl/lib/r600/workitem/get_local_id.cl
    libclc/opencl/lib/r600/workitem/get_local_size.cl
    libclc/opencl/lib/r600/workitem/get_num_groups.cl
    libclc/opencl/lib/r600/workitem/get_work_dim.cl
    libclc/opencl/lib/spirv/SOURCES
    libclc/opencl/lib/spirv/math/fma.cl
    libclc/opencl/lib/spirv/subnormal_config.cl
    libclc/utils/gen_convert.py

Modified: 
    libclc/CMakeLists.txt
    libclc/cmake/modules/AddLibclc.cmake

Removed: 
    libclc/amdgcn-amdhsa/lib/SOURCES
    libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl
    libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl
    libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
    libclc/amdgcn/lib/SOURCES
    libclc/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll
    libclc/amdgcn/lib/mem_fence/fence.cl
    libclc/amdgcn/lib/synchronization/barrier.cl
    libclc/amdgcn/lib/workitem/get_global_offset.cl
    libclc/amdgcn/lib/workitem/get_global_size.cl
    libclc/amdgcn/lib/workitem/get_group_id.cl
    libclc/amdgcn/lib/workitem/get_local_id.cl
    libclc/amdgcn/lib/workitem/get_local_size.cl
    libclc/amdgcn/lib/workitem/get_num_groups.cl
    libclc/amdgcn/lib/workitem/get_work_dim.cl
    libclc/clspv/lib/SOURCES
    libclc/clspv/lib/math/fma.cl
    libclc/clspv/lib/shared/vstore_half.cl
    libclc/clspv/lib/shared/vstore_half.inc
    libclc/clspv/lib/subnormal_config.cl
    libclc/generic/include/clc/as_type.h
    libclc/generic/include/clc/async/async_work_group_copy.h
    libclc/generic/include/clc/async/async_work_group_copy.inc
    libclc/generic/include/clc/async/async_work_group_strided_copy.h
    libclc/generic/include/clc/async/async_work_group_strided_copy.inc
    libclc/generic/include/clc/async/prefetch.h
    libclc/generic/include/clc/async/prefetch.inc
    libclc/generic/include/clc/async/wait_group_events.h
    libclc/generic/include/clc/atomic/atom_add.h
    libclc/generic/include/clc/atomic/atom_and.h
    libclc/generic/include/clc/atomic/atom_cmpxchg.h
    libclc/generic/include/clc/atomic/atom_dec.h
    libclc/generic/include/clc/atomic/atom_decl_int32.inc
    libclc/generic/include/clc/atomic/atom_decl_int64.inc
    libclc/generic/include/clc/atomic/atom_inc.h
    libclc/generic/include/clc/atomic/atom_max.h
    libclc/generic/include/clc/atomic/atom_min.h
    libclc/generic/include/clc/atomic/atom_or.h
    libclc/generic/include/clc/atomic/atom_sub.h
    libclc/generic/include/clc/atomic/atom_xchg.h
    libclc/generic/include/clc/atomic/atom_xor.h
    libclc/generic/include/clc/atomic/atomic_add.h
    libclc/generic/include/clc/atomic/atomic_and.h
    libclc/generic/include/clc/atomic/atomic_cmpxchg.h
    libclc/generic/include/clc/atomic/atomic_dec.h
    libclc/generic/include/clc/atomic/atomic_decl.inc
    libclc/generic/include/clc/atomic/atomic_inc.h
    libclc/generic/include/clc/atomic/atomic_max.h
    libclc/generic/include/clc/atomic/atomic_min.h
    libclc/generic/include/clc/atomic/atomic_or.h
    libclc/generic/include/clc/atomic/atomic_sub.h
    libclc/generic/include/clc/atomic/atomic_xchg.h
    libclc/generic/include/clc/atomic/atomic_xor.h
    libclc/generic/include/clc/clc.h
    libclc/generic/include/clc/common/degrees.h
    libclc/generic/include/clc/common/degrees.inc
    libclc/generic/include/clc/common/mix.h
    libclc/generic/include/clc/common/mix.inc
    libclc/generic/include/clc/common/radians.h
    libclc/generic/include/clc/common/radians.inc
    libclc/generic/include/clc/common/sign.h
    libclc/generic/include/clc/common/smoothstep.h
    libclc/generic/include/clc/common/smoothstep.inc
    libclc/generic/include/clc/common/step.h
    libclc/generic/include/clc/common/step.inc
    libclc/generic/include/clc/convert.h
    libclc/generic/include/clc/explicit_fence/explicit_memory_fence.h
    libclc/generic/include/clc/geometric/cross.h
    libclc/generic/include/clc/geometric/distance.h
    libclc/generic/include/clc/geometric/dot.h
    libclc/generic/include/clc/geometric/fast_distance.h
    libclc/generic/include/clc/geometric/fast_length.h
    libclc/generic/include/clc/geometric/fast_normalize.h
    libclc/generic/include/clc/geometric/length.h
    libclc/generic/include/clc/geometric/normalize.h
    libclc/generic/include/clc/image/image.h
    libclc/generic/include/clc/image/image_defines.h
    libclc/generic/include/clc/integer/abs.h
    libclc/generic/include/clc/integer/abs.inc
    libclc/generic/include/clc/integer/abs_diff.h
    libclc/generic/include/clc/integer/abs_diff.inc
    libclc/generic/include/clc/integer/add_sat.h
    libclc/generic/include/clc/integer/add_sat.inc
    libclc/generic/include/clc/integer/clz.h
    libclc/generic/include/clc/integer/ctz.h
    libclc/generic/include/clc/integer/hadd.h
    libclc/generic/include/clc/integer/mad24.h
    libclc/generic/include/clc/integer/mad_hi.h
    libclc/generic/include/clc/integer/mad_sat.h
    libclc/generic/include/clc/integer/mad_sat.inc
    libclc/generic/include/clc/integer/mul24.h
    libclc/generic/include/clc/integer/mul_hi.h
    libclc/generic/include/clc/integer/popcount.h
    libclc/generic/include/clc/integer/rhadd.h
    libclc/generic/include/clc/integer/rotate.h
    libclc/generic/include/clc/integer/rotate.inc
    libclc/generic/include/clc/integer/sub_sat.h
    libclc/generic/include/clc/integer/sub_sat.inc
    libclc/generic/include/clc/integer/unary.inc
    libclc/generic/include/clc/integer/upsample.h
    libclc/generic/include/clc/math/acos.h
    libclc/generic/include/clc/math/acosh.h
    libclc/generic/include/clc/math/acospi.h
    libclc/generic/include/clc/math/asin.h
    libclc/generic/include/clc/math/asinh.h
    libclc/generic/include/clc/math/asinpi.h
    libclc/generic/include/clc/math/atan.h
    libclc/generic/include/clc/math/atan2.h
    libclc/generic/include/clc/math/atan2pi.h
    libclc/generic/include/clc/math/atanh.h
    libclc/generic/include/clc/math/atanpi.h
    libclc/generic/include/clc/math/cbrt.h
    libclc/generic/include/clc/math/ceil.h
    libclc/generic/include/clc/math/copysign.h
    libclc/generic/include/clc/math/cos.h
    libclc/generic/include/clc/math/cosh.h
    libclc/generic/include/clc/math/cospi.h
    libclc/generic/include/clc/math/erf.h
    libclc/generic/include/clc/math/erfc.h
    libclc/generic/include/clc/math/exp.h
    libclc/generic/include/clc/math/exp10.h
    libclc/generic/include/clc/math/exp2.h
    libclc/generic/include/clc/math/expm1.h
    libclc/generic/include/clc/math/fabs.h
    libclc/generic/include/clc/math/fdim.h
    libclc/generic/include/clc/math/floor.h
    libclc/generic/include/clc/math/fma.h
    libclc/generic/include/clc/math/fmax.h
    libclc/generic/include/clc/math/fmin.h
    libclc/generic/include/clc/math/fmod.h
    libclc/generic/include/clc/math/fract.h
    libclc/generic/include/clc/math/frexp.h
    libclc/generic/include/clc/math/frexp.inc
    libclc/generic/include/clc/math/half_cos.h
    libclc/generic/include/clc/math/half_divide.h
    libclc/generic/include/clc/math/half_exp.h
    libclc/generic/include/clc/math/half_exp10.h
    libclc/generic/include/clc/math/half_exp2.h
    libclc/generic/include/clc/math/half_log.h
    libclc/generic/include/clc/math/half_log10.h
    libclc/generic/include/clc/math/half_log2.h
    libclc/generic/include/clc/math/half_powr.h
    libclc/generic/include/clc/math/half_recip.h
    libclc/generic/include/clc/math/half_rsqrt.h
    libclc/generic/include/clc/math/half_sin.h
    libclc/generic/include/clc/math/half_sqrt.h
    libclc/generic/include/clc/math/half_tan.h
    libclc/generic/include/clc/math/hypot.h
    libclc/generic/include/clc/math/ilogb.h
    libclc/generic/include/clc/math/ldexp.h
    libclc/generic/include/clc/math/ldexp.inc
    libclc/generic/include/clc/math/lgamma.h
    libclc/generic/include/clc/math/lgamma_r.h
    libclc/generic/include/clc/math/log.h
    libclc/generic/include/clc/math/log10.h
    libclc/generic/include/clc/math/log1p.h
    libclc/generic/include/clc/math/log2.h
    libclc/generic/include/clc/math/logb.h
    libclc/generic/include/clc/math/mad.h
    libclc/generic/include/clc/math/maxmag.h
    libclc/generic/include/clc/math/minmag.h
    libclc/generic/include/clc/math/modf.h
    libclc/generic/include/clc/math/nan.h
    libclc/generic/include/clc/math/nan.inc
    libclc/generic/include/clc/math/native_cos.h
    libclc/generic/include/clc/math/native_divide.h
    libclc/generic/include/clc/math/native_exp.h
    libclc/generic/include/clc/math/native_exp10.h
    libclc/generic/include/clc/math/native_exp2.h
    libclc/generic/include/clc/math/native_log.h
    libclc/generic/include/clc/math/native_log10.h
    libclc/generic/include/clc/math/native_log2.h
    libclc/generic/include/clc/math/native_powr.h
    libclc/generic/include/clc/math/native_recip.h
    libclc/generic/include/clc/math/native_rsqrt.h
    libclc/generic/include/clc/math/native_sin.h
    libclc/generic/include/clc/math/native_sqrt.h
    libclc/generic/include/clc/math/native_tan.h
    libclc/generic/include/clc/math/nextafter.h
    libclc/generic/include/clc/math/pow.h
    libclc/generic/include/clc/math/pown.h
    libclc/generic/include/clc/math/powr.h
    libclc/generic/include/clc/math/remainder.h
    libclc/generic/include/clc/math/remquo.h
    libclc/generic/include/clc/math/rint.h
    libclc/generic/include/clc/math/rootn.h
    libclc/generic/include/clc/math/round.h
    libclc/generic/include/clc/math/rsqrt.h
    libclc/generic/include/clc/math/sin.h
    libclc/generic/include/clc/math/sincos.h
    libclc/generic/include/clc/math/sinh.h
    libclc/generic/include/clc/math/sinpi.h
    libclc/generic/include/clc/math/sqrt.h
    libclc/generic/include/clc/math/tan.h
    libclc/generic/include/clc/math/tanh.h
    libclc/generic/include/clc/math/tanpi.h
    libclc/generic/include/clc/math/tgamma.h
    libclc/generic/include/clc/math/trunc.h
    libclc/generic/include/clc/misc/shuffle.h
    libclc/generic/include/clc/misc/shuffle2.h
    libclc/generic/include/clc/relational/all.h
    libclc/generic/include/clc/relational/any.h
    libclc/generic/include/clc/relational/bitselect.h
    libclc/generic/include/clc/relational/bitselect.inc
    libclc/generic/include/clc/relational/isequal.h
    libclc/generic/include/clc/relational/isfinite.h
    libclc/generic/include/clc/relational/isgreater.h
    libclc/generic/include/clc/relational/isgreaterequal.h
    libclc/generic/include/clc/relational/isinf.h
    libclc/generic/include/clc/relational/isless.h
    libclc/generic/include/clc/relational/islessequal.h
    libclc/generic/include/clc/relational/islessgreater.h
    libclc/generic/include/clc/relational/isnan.h
    libclc/generic/include/clc/relational/isnormal.h
    libclc/generic/include/clc/relational/isnotequal.h
    libclc/generic/include/clc/relational/isordered.h
    libclc/generic/include/clc/relational/isunordered.h
    libclc/generic/include/clc/relational/select.h
    libclc/generic/include/clc/relational/signbit.h
    libclc/generic/include/clc/shared/clamp.h
    libclc/generic/include/clc/shared/clamp.inc
    libclc/generic/include/clc/shared/max.h
    libclc/generic/include/clc/shared/max.inc
    libclc/generic/include/clc/shared/min.h
    libclc/generic/include/clc/shared/min.inc
    libclc/generic/include/clc/shared/vload.h
    libclc/generic/include/clc/shared/vstore.h
    libclc/generic/include/clc/synchronization/barrier.h
    libclc/generic/include/clc/synchronization/cl_mem_fence_flags.h
    libclc/generic/include/clc/workitem/get_global_id.h
    libclc/generic/include/clc/workitem/get_global_offset.h
    libclc/generic/include/clc/workitem/get_global_size.h
    libclc/generic/include/clc/workitem/get_group_id.h
    libclc/generic/include/clc/workitem/get_local_id.h
    libclc/generic/include/clc/workitem/get_local_size.h
    libclc/generic/include/clc/workitem/get_num_groups.h
    libclc/generic/include/clc/workitem/get_work_dim.h
    libclc/generic/lib/SOURCES
    libclc/generic/lib/async/async_work_group_copy.cl
    libclc/generic/lib/async/async_work_group_copy.inc
    libclc/generic/lib/async/async_work_group_strided_copy.cl
    libclc/generic/lib/async/async_work_group_strided_copy.inc
    libclc/generic/lib/async/prefetch.cl
    libclc/generic/lib/async/prefetch.inc
    libclc/generic/lib/async/wait_group_events.cl
    libclc/generic/lib/atomic/atom_add.cl
    libclc/generic/lib/atomic/atom_and.cl
    libclc/generic/lib/atomic/atom_cmpxchg.cl
    libclc/generic/lib/atomic/atom_dec.cl
    libclc/generic/lib/atomic/atom_inc.cl
    libclc/generic/lib/atomic/atom_int32_binary.inc
    libclc/generic/lib/atomic/atom_max.cl
    libclc/generic/lib/atomic/atom_min.cl
    libclc/generic/lib/atomic/atom_or.cl
    libclc/generic/lib/atomic/atom_sub.cl
    libclc/generic/lib/atomic/atom_xchg.cl
    libclc/generic/lib/atomic/atom_xor.cl
    libclc/generic/lib/atomic/atomic_add.cl
    libclc/generic/lib/atomic/atomic_and.cl
    libclc/generic/lib/atomic/atomic_cmpxchg.cl
    libclc/generic/lib/atomic/atomic_dec.cl
    libclc/generic/lib/atomic/atomic_inc.cl
    libclc/generic/lib/atomic/atomic_max.cl
    libclc/generic/lib/atomic/atomic_min.cl
    libclc/generic/lib/atomic/atomic_or.cl
    libclc/generic/lib/atomic/atomic_sub.cl
    libclc/generic/lib/atomic/atomic_xchg.cl
    libclc/generic/lib/atomic/atomic_xor.cl
    libclc/generic/lib/common/degrees.cl
    libclc/generic/lib/common/mix.cl
    libclc/generic/lib/common/mix.inc
    libclc/generic/lib/common/radians.cl
    libclc/generic/lib/common/sign.cl
    libclc/generic/lib/common/smoothstep.cl
    libclc/generic/lib/common/step.cl
    libclc/generic/lib/gen_convert.py
    libclc/generic/lib/geometric/cross.cl
    libclc/generic/lib/geometric/distance.cl
    libclc/generic/lib/geometric/dot.cl
    libclc/generic/lib/geometric/fast_distance.cl
    libclc/generic/lib/geometric/fast_length.cl
    libclc/generic/lib/geometric/fast_normalize.cl
    libclc/generic/lib/geometric/fast_normalize.inc
    libclc/generic/lib/geometric/length.cl
    libclc/generic/lib/geometric/normalize.cl
    libclc/generic/lib/integer/abs.cl
    libclc/generic/lib/integer/abs.inc
    libclc/generic/lib/integer/abs_diff.cl
    libclc/generic/lib/integer/abs_diff.inc
    libclc/generic/lib/integer/add_sat.cl
    libclc/generic/lib/integer/clz.cl
    libclc/generic/lib/integer/ctz.cl
    libclc/generic/lib/integer/hadd.cl
    libclc/generic/lib/integer/mad24.cl
    libclc/generic/lib/integer/mad_hi.cl
    libclc/generic/lib/integer/mad_sat.cl
    libclc/generic/lib/integer/mul24.cl
    libclc/generic/lib/integer/mul_hi.cl
    libclc/generic/lib/integer/popcount.cl
    libclc/generic/lib/integer/rhadd.cl
    libclc/generic/lib/integer/rotate.cl
    libclc/generic/lib/integer/sub_sat.cl
    libclc/generic/lib/integer/upsample.cl
    libclc/generic/lib/math/acos.cl
    libclc/generic/lib/math/acosh.cl
    libclc/generic/lib/math/acospi.cl
    libclc/generic/lib/math/asin.cl
    libclc/generic/lib/math/asinh.cl
    libclc/generic/lib/math/asinpi.cl
    libclc/generic/lib/math/atan.cl
    libclc/generic/lib/math/atan2.cl
    libclc/generic/lib/math/atan2pi.cl
    libclc/generic/lib/math/atanh.cl
    libclc/generic/lib/math/atanpi.cl
    libclc/generic/lib/math/cbrt.cl
    libclc/generic/lib/math/ceil.cl
    libclc/generic/lib/math/copysign.cl
    libclc/generic/lib/math/cos.cl
    libclc/generic/lib/math/cosh.cl
    libclc/generic/lib/math/cospi.cl
    libclc/generic/lib/math/erf.cl
    libclc/generic/lib/math/erfc.cl
    libclc/generic/lib/math/exp.cl
    libclc/generic/lib/math/exp10.cl
    libclc/generic/lib/math/exp2.cl
    libclc/generic/lib/math/expm1.cl
    libclc/generic/lib/math/fabs.cl
    libclc/generic/lib/math/fdim.cl
    libclc/generic/lib/math/floor.cl
    libclc/generic/lib/math/fma.cl
    libclc/generic/lib/math/fmax.cl
    libclc/generic/lib/math/fmax.inc
    libclc/generic/lib/math/fmin.cl
    libclc/generic/lib/math/fmin.inc
    libclc/generic/lib/math/fmod.cl
    libclc/generic/lib/math/fract.cl
    libclc/generic/lib/math/frexp.cl
    libclc/generic/lib/math/half_cos.cl
    libclc/generic/lib/math/half_divide.cl
    libclc/generic/lib/math/half_exp.cl
    libclc/generic/lib/math/half_exp10.cl
    libclc/generic/lib/math/half_exp2.cl
    libclc/generic/lib/math/half_log.cl
    libclc/generic/lib/math/half_log10.cl
    libclc/generic/lib/math/half_log2.cl
    libclc/generic/lib/math/half_powr.cl
    libclc/generic/lib/math/half_recip.cl
    libclc/generic/lib/math/half_rsqrt.cl
    libclc/generic/lib/math/half_sin.cl
    libclc/generic/lib/math/half_sqrt.cl
    libclc/generic/lib/math/half_tan.cl
    libclc/generic/lib/math/hypot.cl
    libclc/generic/lib/math/ilogb.cl
    libclc/generic/lib/math/ldexp.cl
    libclc/generic/lib/math/ldexp.inc
    libclc/generic/lib/math/lgamma.cl
    libclc/generic/lib/math/lgamma_r.cl
    libclc/generic/lib/math/log.cl
    libclc/generic/lib/math/log10.cl
    libclc/generic/lib/math/log1p.cl
    libclc/generic/lib/math/log2.cl
    libclc/generic/lib/math/logb.cl
    libclc/generic/lib/math/mad.cl
    libclc/generic/lib/math/maxmag.cl
    libclc/generic/lib/math/minmag.cl
    libclc/generic/lib/math/modf.cl
    libclc/generic/lib/math/nan.cl
    libclc/generic/lib/math/nan.inc
    libclc/generic/lib/math/native_cos.cl
    libclc/generic/lib/math/native_divide.cl
    libclc/generic/lib/math/native_exp.cl
    libclc/generic/lib/math/native_exp10.cl
    libclc/generic/lib/math/native_exp2.cl
    libclc/generic/lib/math/native_log.cl
    libclc/generic/lib/math/native_log10.cl
    libclc/generic/lib/math/native_log2.cl
    libclc/generic/lib/math/native_powr.cl
    libclc/generic/lib/math/native_recip.cl
    libclc/generic/lib/math/native_rsqrt.cl
    libclc/generic/lib/math/native_sin.cl
    libclc/generic/lib/math/native_sqrt.cl
    libclc/generic/lib/math/native_tan.cl
    libclc/generic/lib/math/nextafter.cl
    libclc/generic/lib/math/pow.cl
    libclc/generic/lib/math/pown.cl
    libclc/generic/lib/math/powr.cl
    libclc/generic/lib/math/remainder.cl
    libclc/generic/lib/math/remquo.cl
    libclc/generic/lib/math/remquo.inc
    libclc/generic/lib/math/rint.cl
    libclc/generic/lib/math/rootn.cl
    libclc/generic/lib/math/round.cl
    libclc/generic/lib/math/rsqrt.cl
    libclc/generic/lib/math/sin.cl
    libclc/generic/lib/math/sincos.cl
    libclc/generic/lib/math/sinh.cl
    libclc/generic/lib/math/sinpi.cl
    libclc/generic/lib/math/sqrt.cl
    libclc/generic/lib/math/tan.cl
    libclc/generic/lib/math/tanh.cl
    libclc/generic/lib/math/tanpi.cl
    libclc/generic/lib/math/tgamma.cl
    libclc/generic/lib/math/trunc.cl
    libclc/generic/lib/misc/shuffle.cl
    libclc/generic/lib/misc/shuffle2.cl
    libclc/generic/lib/relational/all.cl
    libclc/generic/lib/relational/any.cl
    libclc/generic/lib/relational/binary_def.inc
    libclc/generic/lib/relational/bitselect.cl
    libclc/generic/lib/relational/bitselect.inc
    libclc/generic/lib/relational/isequal.cl
    libclc/generic/lib/relational/isfinite.cl
    libclc/generic/lib/relational/isgreater.cl
    libclc/generic/lib/relational/isgreaterequal.cl
    libclc/generic/lib/relational/isinf.cl
    libclc/generic/lib/relational/isless.cl
    libclc/generic/lib/relational/islessequal.cl
    libclc/generic/lib/relational/islessgreater.cl
    libclc/generic/lib/relational/isnan.cl
    libclc/generic/lib/relational/isnormal.cl
    libclc/generic/lib/relational/isnotequal.cl
    libclc/generic/lib/relational/isordered.cl
    libclc/generic/lib/relational/isunordered.cl
    libclc/generic/lib/relational/select.cl
    libclc/generic/lib/relational/signbit.cl
    libclc/generic/lib/relational/unary_def.inc
    libclc/generic/lib/shared/clamp.cl
    libclc/generic/lib/shared/clamp.inc
    libclc/generic/lib/shared/max.cl
    libclc/generic/lib/shared/max.inc
    libclc/generic/lib/shared/min.cl
    libclc/generic/lib/shared/min.inc
    libclc/generic/lib/shared/vload.cl
    libclc/generic/lib/shared/vload_half.inc
    libclc/generic/lib/shared/vstore.cl
    libclc/generic/lib/shared/vstore_half.inc
    libclc/generic/lib/subnormal_config.cl
    libclc/generic/lib/subnormal_disable.ll
    libclc/generic/lib/subnormal_helper_func.ll
    libclc/generic/lib/subnormal_use_default.ll
    libclc/generic/lib/workitem/get_global_id.cl
    libclc/generic/lib/workitem/get_global_size.cl
    libclc/ptx-nvidiacl/lib/SOURCES
    libclc/ptx-nvidiacl/lib/mem_fence/fence.cl
    libclc/ptx-nvidiacl/lib/synchronization/barrier.cl
    libclc/ptx-nvidiacl/lib/workitem/get_global_id.cl
    libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl
    libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl
    libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl
    libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl
    libclc/r600/lib/SOURCES
    libclc/r600/lib/SOURCES_3.9
    libclc/r600/lib/image/get_image_attributes_impl.ll
    libclc/r600/lib/image/get_image_channel_data_type.cl
    libclc/r600/lib/image/get_image_channel_order.cl
    libclc/r600/lib/image/get_image_depth.cl
    libclc/r600/lib/image/get_image_dim.cl
    libclc/r600/lib/image/get_image_height.cl
    libclc/r600/lib/image/get_image_width.cl
    libclc/r600/lib/image/read_image_impl.ll
    libclc/r600/lib/image/read_imagef.cl
    libclc/r600/lib/image/read_imagei.cl
    libclc/r600/lib/image/read_imageui.cl
    libclc/r600/lib/image/write_image_impl.ll
    libclc/r600/lib/image/write_imagef.cl
    libclc/r600/lib/image/write_imagei.cl
    libclc/r600/lib/image/write_imageui.cl
    libclc/r600/lib/synchronization/barrier.cl
    libclc/r600/lib/workitem/get_global_offset.cl
    libclc/r600/lib/workitem/get_global_size.cl
    libclc/r600/lib/workitem/get_group_id.cl
    libclc/r600/lib/workitem/get_local_id.cl
    libclc/r600/lib/workitem/get_local_size.cl
    libclc/r600/lib/workitem/get_num_groups.cl
    libclc/r600/lib/workitem/get_work_dim.cl
    libclc/spirv/lib/SOURCES
    libclc/spirv/lib/math/fma.cl
    libclc/spirv/lib/subnormal_config.cl


################################################################################
diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index b0e7aac6f8f36..70b11df3b3142 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -18,13 +18,14 @@ include( AddLibclc )
 
 include( GNUInstallDirs )
 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
-  amdgcn-amdhsa/lib/SOURCES;
-  amdgcn/lib/SOURCES;
-  clspv/lib/SOURCES;
-  generic/lib/SOURCES;
-  ptx-nvidiacl/lib/SOURCES;
-  r600/lib/SOURCES;
-  spirv/lib/SOURCES;
+  # OpenCL libraries
+  opencl/lib/amdgcn-amdhsa/SOURCES;
+  opencl/lib/amdgcn/SOURCES;
+  opencl/lib/clspv/SOURCES;
+  opencl/lib/generic/SOURCES;
+  opencl/lib/ptx-nvidiacl/SOURCES;
+  opencl/lib/r600/SOURCES;
+  opencl/lib/spirv/SOURCES;
   # CLC internal libraries
   clc/lib/generic/SOURCES;
   clc/lib/amdgcn/SOURCES;
@@ -227,7 +228,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
   foreach( file IN ITEMS subnormal_use_default subnormal_disable )
     link_bc(
        TARGET ${file}
-       INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/${file}.ll
+       INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/${file}.ll
     )
     install(
       FILES $<TARGET_PROPERTY:${file},TARGET_FILE>
@@ -237,7 +238,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
 endif()
 
 find_package( Python3 REQUIRED COMPONENTS Interpreter )
-file( TO_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/gen_convert.py script_loc )
+file( TO_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/utils/gen_convert.py script_loc )
 add_custom_command(
   OUTPUT convert.cl
   COMMAND ${Python3_EXECUTABLE} ${script_loc} > convert.cl
@@ -283,20 +284,20 @@ set_source_files_properties(
   ${CMAKE_CURRENT_SOURCE_DIR}/clc/lib/amdgpu/math/clc_native_log10.cl
   ${CMAKE_CURRENT_SOURCE_DIR}/clc/lib/r600/math/clc_native_rsqrt.cl
   # OpenCL builtins
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_cos.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_divide.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_exp.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_exp10.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_exp2.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_log.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_log10.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_log2.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_powr.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_recip.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_rsqrt.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_sin.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_sqrt.cl
-  ${CMAKE_CURRENT_SOURCE_DIR}/generic/lib/math/native_tan.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_cos.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_divide.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_exp.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_exp10.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_exp2.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_log.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_log10.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_log2.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_powr.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_recip.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_rsqrt.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_sin.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_sqrt.cl
+  ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_tan.cl
   PROPERTIES COMPILE_OPTIONS -fapprox-func
 )
 
@@ -351,7 +352,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 
   libclc_configure_lib_source(
     clc_lib_files
-    CLC_INTERNAL
     LIB_ROOT_DIR clc
     DIRS ${clc_dirs}
   )
@@ -365,13 +365,14 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
     else()
       list( APPEND opencl_gen_files convert.cl )
       if ( NOT ENABLE_RUNTIME_SUBNORMAL )
-        list( APPEND opencl_lib_files generic/lib/subnormal_use_default.ll )
+        list( APPEND opencl_lib_files opencl/lib/generic/subnormal_use_default.ll )
       endif()
     endif()
   endif()
 
   libclc_configure_lib_source(
     opencl_lib_files
+    LIB_ROOT_DIR opencl
     DIRS ${opencl_dirs}
   )
 
@@ -439,7 +440,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
     )
 
     list( APPEND build_flags
-      -I${CMAKE_CURRENT_SOURCE_DIR}/generic/include
+      -I${CMAKE_CURRENT_SOURCE_DIR}/opencl/include
     )
 
     add_libclc_builtin_set(

diff  --git a/libclc/clspv/lib/SOURCES b/libclc/clspv/lib/SOURCES
deleted file mode 100644
index d7cd36d09349b..0000000000000
--- a/libclc/clspv/lib/SOURCES
+++ /dev/null
@@ -1,73 +0,0 @@
-math/fma.cl
-shared/vstore_half.cl
-subnormal_config.cl
-../../generic/lib/geometric/distance.cl
-../../generic/lib/geometric/length.cl
-../../generic/lib/math/acos.cl
-../../generic/lib/math/acosh.cl
-../../generic/lib/math/asinh.cl
-../../generic/lib/math/acospi.cl
-../../generic/lib/math/asin.cl
-../../generic/lib/math/atan.cl
-../../generic/lib/math/asinh.cl
-../../generic/lib/math/asinpi.cl
-../../generic/lib/math/atan2.cl
-../../generic/lib/math/atan2pi.cl
-../../generic/lib/math/atanh.cl
-../../generic/lib/math/atanpi.cl
-../../generic/lib/math/cbrt.cl
-../../generic/lib/math/cos.cl
-../../generic/lib/math/cosh.cl
-../../generic/lib/math/cospi.cl
-../../generic/lib/math/erf.cl
-../../generic/lib/math/erfc.cl
-../../generic/lib/math/exp.cl
-../../generic/lib/math/exp10.cl
-../../generic/lib/math/exp2.cl
-../../generic/lib/math/expm1.cl
-../../generic/lib/math/fdim.cl
-../../generic/lib/math/fmod.cl
-../../generic/lib/math/fract.cl
-../../generic/lib/math/frexp.cl
-../../generic/lib/math/half_cos.cl
-../../generic/lib/math/half_divide.cl
-../../generic/lib/math/half_exp.cl
-../../generic/lib/math/half_exp10.cl
-../../generic/lib/math/half_exp2.cl
-../../generic/lib/math/half_log.cl
-../../generic/lib/math/half_log10.cl
-../../generic/lib/math/half_log2.cl
-../../generic/lib/math/half_powr.cl
-../../generic/lib/math/half_recip.cl
-../../generic/lib/math/half_sin.cl
-../../generic/lib/math/half_sqrt.cl
-../../generic/lib/math/half_tan.cl
-../../generic/lib/math/hypot.cl
-../../generic/lib/math/ilogb.cl
-../../generic/lib/math/ldexp.cl
-../../generic/lib/math/lgamma.cl
-../../generic/lib/math/lgamma_r.cl
-../../generic/lib/math/log.cl
-../../generic/lib/math/log10.cl
-../../generic/lib/math/log1p.cl
-../../generic/lib/math/log2.cl
-../../generic/lib/math/logb.cl
-../../generic/lib/math/maxmag.cl
-../../generic/lib/math/minmag.cl
-../../generic/lib/math/modf.cl
-../../generic/lib/math/nan.cl
-../../generic/lib/math/nextafter.cl
-../../generic/lib/math/pow.cl
-../../generic/lib/math/pown.cl
-../../generic/lib/math/powr.cl
-../../generic/lib/math/remainder.cl
-../../generic/lib/math/remquo.cl
-../../generic/lib/math/rootn.cl
-../../generic/lib/math/sin.cl
-../../generic/lib/math/sincos.cl
-../../generic/lib/math/sinh.cl
-../../generic/lib/math/sinpi.cl
-../../generic/lib/math/tan.cl
-../../generic/lib/math/tanh.cl
-../../generic/lib/math/tanpi.cl
-../../generic/lib/math/tgamma.cl

diff  --git a/libclc/cmake/modules/AddLibclc.cmake b/libclc/cmake/modules/AddLibclc.cmake
index d00b16a899664..597bb642655e4 100644
--- a/libclc/cmake/modules/AddLibclc.cmake
+++ b/libclc/cmake/modules/AddLibclc.cmake
@@ -424,9 +424,6 @@ endfunction(add_libclc_builtin_set)
 # LIB_FILE_LIST may be pre-populated and is appended to.
 #
 # Arguments:
-# * CLC_INTERNAL
-#     Pass if compiling the internal CLC builtin libraries, which have a
-#     
diff erent directory structure.
 # * LIB_ROOT_DIR <string>
 #     Root directory containing target's lib files, relative to libclc root
 #     directory. If not provided, is set to '.'.
@@ -436,7 +433,7 @@ endfunction(add_libclc_builtin_set)
 #     subsequent ones.
 function(libclc_configure_lib_source LIB_FILE_LIST)
   cmake_parse_arguments(ARG
-    "CLC_INTERNAL"
+    ""
     "LIB_ROOT_DIR"
     "DIRS"
     ${ARGN}
@@ -450,11 +447,7 @@ function(libclc_configure_lib_source LIB_FILE_LIST)
   set( source_list )
   foreach( l IN LISTS ARG_DIRS )
     foreach( s "SOURCES" "SOURCES_${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}" )
-      if( ARG_CLC_INTERNAL )
-        file( TO_CMAKE_PATH ${ARG_LIB_ROOT_DIR}/lib/${l}/${s} file_loc )
-      else()
-        file( TO_CMAKE_PATH ${ARG_LIB_ROOT_DIR}/${l}/lib/${s} file_loc )
-      endif()
+      file( TO_CMAKE_PATH ${ARG_LIB_ROOT_DIR}/lib/${l}/${s} file_loc )
       file( TO_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${file_loc} loc )
       # Prepend the location to give higher priority to the specialized
       # implementation

diff  --git a/libclc/generic/include/clc/atomic/atomic_dec.h b/libclc/generic/include/clc/atomic/atomic_dec.h
deleted file mode 100644
index aca1b95926a20..0000000000000
--- a/libclc/generic/include/clc/atomic/atomic_dec.h
+++ /dev/null
@@ -1,12 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL int atomic_dec (volatile local int *);
-_CLC_OVERLOAD _CLC_DECL int atomic_dec (volatile global int *);
-_CLC_OVERLOAD _CLC_DECL uint atomic_dec (volatile local uint *);
-_CLC_OVERLOAD _CLC_DECL uint atomic_dec (volatile global uint *);

diff  --git a/libclc/generic/include/clc/atomic/atomic_inc.h b/libclc/generic/include/clc/atomic/atomic_inc.h
deleted file mode 100644
index daf1d8feb2c53..0000000000000
--- a/libclc/generic/include/clc/atomic/atomic_inc.h
+++ /dev/null
@@ -1,12 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL int atomic_inc (volatile local int *);
-_CLC_OVERLOAD _CLC_DECL int atomic_inc (volatile global int *);
-_CLC_OVERLOAD _CLC_DECL uint atomic_inc (volatile local uint *);
-_CLC_OVERLOAD _CLC_DECL uint atomic_inc (volatile global uint *);

diff  --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h
deleted file mode 100644
index f4c0dc7c0bee4..0000000000000
--- a/libclc/generic/include/clc/clc.h
+++ /dev/null
@@ -1,267 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef __CLC_CLC_H__
-#define __CLC_CLC_H__
-
-#ifndef cl_clang_storage_class_specifiers
-#error Implementation requires cl_clang_storage_class_specifiers extension!
-#endif
-
-#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
-
-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-#endif
-
-#ifdef cl_khr_fp16
-#pragma OPENCL EXTENSION cl_khr_fp16 : enable
-#endif
-
-/* Function Attributes */
-#include <clc/clcfunc.h>
-
-/* 6.1 Supported Data Types */
-#include <clc/clctypes.h>
-
-/* 6.2.3 Explicit Conversions */
-#include <clc/convert.h>
-
-/* 6.2.4.2 Reinterpreting Types Using as_type() and as_typen() */
-#include <clc/as_type.h>
-
-/* 6.11.1 Work-Item Functions */
-#include <clc/workitem/get_global_size.h>
-#include <clc/workitem/get_global_id.h>
-#include <clc/workitem/get_local_size.h>
-#include <clc/workitem/get_local_id.h>
-#include <clc/workitem/get_num_groups.h>
-#include <clc/workitem/get_group_id.h>
-#include <clc/workitem/get_global_offset.h>
-#include <clc/workitem/get_work_dim.h>
-
-/* 6.11.2 Math Functions */
-#include <clc/math/acos.h>
-#include <clc/math/acosh.h>
-#include <clc/math/acospi.h>
-#include <clc/math/asin.h>
-#include <clc/math/asinh.h>
-#include <clc/math/asinpi.h>
-#include <clc/math/atan.h>
-#include <clc/math/atan2.h>
-#include <clc/math/atan2pi.h>
-#include <clc/math/atanh.h>
-#include <clc/math/atanpi.h>
-#include <clc/math/cbrt.h>
-#include <clc/math/copysign.h>
-#include <clc/math/cos.h>
-#include <clc/math/cosh.h>
-#include <clc/math/cospi.h>
-#include <clc/math/ceil.h>
-#include <clc/math/erf.h>
-#include <clc/math/erfc.h>
-#include <clc/math/exp.h>
-#include <clc/math/expm1.h>
-#include <clc/math/exp10.h>
-#include <clc/math/exp2.h>
-#include <clc/math/fabs.h>
-#include <clc/math/fdim.h>
-#include <clc/math/floor.h>
-#include <clc/math/fma.h>
-#include <clc/math/fmax.h>
-#include <clc/math/fmin.h>
-#include <clc/math/fmod.h>
-#include <clc/math/fract.h>
-#include <clc/math/frexp.h>
-#include <clc/math/half_cos.h>
-#include <clc/math/half_divide.h>
-#include <clc/math/half_exp.h>
-#include <clc/math/half_exp10.h>
-#include <clc/math/half_exp2.h>
-#include <clc/math/half_log.h>
-#include <clc/math/half_log10.h>
-#include <clc/math/half_log2.h>
-#include <clc/math/half_powr.h>
-#include <clc/math/half_recip.h>
-#include <clc/math/half_rsqrt.h>
-#include <clc/math/half_sin.h>
-#include <clc/math/half_sqrt.h>
-#include <clc/math/half_tan.h>
-#include <clc/math/hypot.h>
-#include <clc/math/ilogb.h>
-#include <clc/math/ldexp.h>
-#include <clc/math/lgamma.h>
-#include <clc/math/lgamma_r.h>
-#include <clc/math/log.h>
-#include <clc/math/log10.h>
-#include <clc/math/log1p.h>
-#include <clc/math/log2.h>
-#include <clc/math/logb.h>
-#include <clc/math/mad.h>
-#include <clc/math/maxmag.h>
-#include <clc/math/minmag.h>
-#include <clc/math/modf.h>
-#include <clc/math/nan.h>
-#include <clc/math/nextafter.h>
-#include <clc/math/pow.h>
-#include <clc/math/pown.h>
-#include <clc/math/powr.h>
-#include <clc/math/remainder.h>
-#include <clc/math/remquo.h>
-#include <clc/math/rint.h>
-#include <clc/math/rootn.h>
-#include <clc/math/round.h>
-#include <clc/math/sin.h>
-#include <clc/math/sincos.h>
-#include <clc/math/sinh.h>
-#include <clc/math/sinpi.h>
-#include <clc/math/sqrt.h>
-#include <clc/math/tan.h>
-#include <clc/math/tanh.h>
-#include <clc/math/tanpi.h>
-#include <clc/math/tgamma.h>
-#include <clc/math/trunc.h>
-#include <clc/math/native_cos.h>
-#include <clc/math/native_divide.h>
-#include <clc/math/native_exp.h>
-#include <clc/math/native_exp10.h>
-#include <clc/math/native_exp2.h>
-#include <clc/math/native_log.h>
-#include <clc/math/native_log10.h>
-#include <clc/math/native_log2.h>
-#include <clc/math/native_powr.h>
-#include <clc/math/native_recip.h>
-#include <clc/math/native_sin.h>
-#include <clc/math/native_sqrt.h>
-#include <clc/math/native_rsqrt.h>
-#include <clc/math/native_tan.h>
-#include <clc/math/rsqrt.h>
-
-/* 6.11.2.1 Floating-point macros */
-#include <clc/float/definitions.h>
-
-/* 6.11.3 Integer Functions */
-#include <clc/integer/abs.h>
-#include <clc/integer/abs_
diff .h>
-#include <clc/integer/add_sat.h>
-#include <clc/integer/clz.h>
-#include <clc/integer/ctz.h>
-#include <clc/integer/hadd.h>
-#include <clc/integer/mad24.h>
-#include <clc/integer/mad_hi.h>
-#include <clc/integer/mad_sat.h>
-#include <clc/integer/mul24.h>
-#include <clc/integer/mul_hi.h>
-#include <clc/integer/popcount.h>
-#include <clc/integer/rhadd.h>
-#include <clc/integer/rotate.h>
-#include <clc/integer/sub_sat.h>
-#include <clc/integer/upsample.h>
-
-/* 6.11.3 Integer Definitions */
-#include <clc/integer/definitions.h>
-
-/* 6.11.2 and 6.11.3 Shared Integer/Math Functions */
-#include <clc/shared/clamp.h>
-#include <clc/shared/max.h>
-#include <clc/shared/min.h>
-#include <clc/shared/vload.h>
-#include <clc/shared/vstore.h>
-
-/* 6.11.4 Common Functions */
-#include <clc/common/degrees.h>
-#include <clc/common/radians.h>
-#include <clc/common/mix.h>
-#include <clc/common/sign.h>
-#include <clc/common/smoothstep.h>
-#include <clc/common/step.h>
-
-/* 6.11.5 Geometric Functions */
-#include <clc/geometric/cross.h>
-#include <clc/geometric/distance.h>
-#include <clc/geometric/dot.h>
-#include <clc/geometric/fast_distance.h>
-#include <clc/geometric/fast_length.h>
-#include <clc/geometric/fast_normalize.h>
-#include <clc/geometric/length.h>
-#include <clc/geometric/normalize.h>
-
-/* 6.11.6 Relational Functions */
-#include <clc/relational/all.h>
-#include <clc/relational/any.h>
-#include <clc/relational/bitselect.h>
-#include <clc/relational/isequal.h>
-#include <clc/relational/isfinite.h>
-#include <clc/relational/isgreater.h>
-#include <clc/relational/isgreaterequal.h>
-#include <clc/relational/isinf.h>
-#include <clc/relational/isless.h>
-#include <clc/relational/islessequal.h>
-#include <clc/relational/islessgreater.h>
-#include <clc/relational/isnan.h>
-#include <clc/relational/isnormal.h>
-#include <clc/relational/isnotequal.h>
-#include <clc/relational/isordered.h>
-#include <clc/relational/isunordered.h>
-#include <clc/relational/select.h>
-#include <clc/relational/signbit.h>
-
-/* 6.11.8 Synchronization Functions */
-#include <clc/synchronization/cl_mem_fence_flags.h>
-#include <clc/synchronization/barrier.h>
-
-/* 6.11.9 Explicit Memory Fence Functions */
-#include <clc/explicit_fence/explicit_memory_fence.h>
-
-/* 6.11.10 Async Copy and Prefetch Functions */
-#include <clc/async/async_work_group_copy.h>
-#include <clc/async/async_work_group_strided_copy.h>
-#include <clc/async/prefetch.h>
-#include <clc/async/wait_group_events.h>
-
-/* 6.11.11 Atomic Functions */
-#include <clc/atomic/atomic_add.h>
-#include <clc/atomic/atomic_and.h>
-#include <clc/atomic/atomic_cmpxchg.h>
-#include <clc/atomic/atomic_dec.h>
-#include <clc/atomic/atomic_inc.h>
-#include <clc/atomic/atomic_max.h>
-#include <clc/atomic/atomic_min.h>
-#include <clc/atomic/atomic_or.h>
-#include <clc/atomic/atomic_sub.h>
-#include <clc/atomic/atomic_xchg.h>
-#include <clc/atomic/atomic_xor.h>
-
-/* cl_khr_global_int32_base_atomics, cl_khr_local_int32_base_atomics and
- * cl_khr_int64_base_atomics Extension Functions */
-#include <clc/atomic/atom_add.h>
-#include <clc/atomic/atom_cmpxchg.h>
-#include <clc/atomic/atom_dec.h>
-#include <clc/atomic/atom_inc.h>
-#include <clc/atomic/atom_sub.h>
-#include <clc/atomic/atom_xchg.h>
-
-/* cl_khr_global_int32_extended_atomics, cl_khr_local_int32_extended_atomics and
- * cl_khr_int64_extended_atomics Extension Functions */
-#include <clc/atomic/atom_and.h>
-#include <clc/atomic/atom_max.h>
-#include <clc/atomic/atom_min.h>
-#include <clc/atomic/atom_or.h>
-#include <clc/atomic/atom_xor.h>
-
-/* 6.12.12 Miscellaneous Vector Functions */
-#include <clc/misc/shuffle.h>
-#include <clc/misc/shuffle2.h>
-
-/* 6.11.13 Image Read and Write Functions */
-#include <clc/image/image_defines.h>
-#include <clc/image/image.h>
-
-#pragma OPENCL EXTENSION all : disable
-
-#endif // __CLC_CLC_H__

diff  --git a/libclc/generic/include/clc/common/degrees.inc b/libclc/generic/include/clc/common/degrees.inc
deleted file mode 100644
index d881decc9ca33..0000000000000
--- a/libclc/generic/include/clc/common/degrees.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE degrees(__CLC_GENTYPE x);

diff  --git a/libclc/generic/include/clc/common/radians.inc b/libclc/generic/include/clc/common/radians.inc
deleted file mode 100644
index 763225a87d5c8..0000000000000
--- a/libclc/generic/include/clc/common/radians.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE radians(__CLC_GENTYPE x);

diff  --git a/libclc/generic/include/clc/image/image.h b/libclc/generic/include/clc/image/image.h
deleted file mode 100644
index 555ec3904c1f8..0000000000000
--- a/libclc/generic/include/clc/image/image.h
+++ /dev/null
@@ -1,48 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#if defined(__opencl_c_images)
-
-_CLC_OVERLOAD _CLC_DECL int get_image_width (image2d_t image);
-_CLC_OVERLOAD _CLC_DECL int get_image_width (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL int get_image_height (image2d_t image);
-_CLC_OVERLOAD _CLC_DECL int get_image_height (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL int get_image_depth (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type (image2d_t image);
-_CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL int get_image_channel_order (image2d_t image);
-_CLC_OVERLOAD _CLC_DECL int get_image_channel_order (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL int2 get_image_dim (image2d_t image);
-_CLC_OVERLOAD _CLC_DECL int4 get_image_dim (image3d_t image);
-
-_CLC_OVERLOAD _CLC_DECL void
-write_imagef(image2d_t image, int2 coord, float4 color);
-_CLC_OVERLOAD _CLC_DECL void
-write_imagei(image2d_t image, int2 coord, int4 color);
-_CLC_OVERLOAD _CLC_DECL void
-write_imageui(image2d_t image, int2 coord, uint4 color);
-
-_CLC_OVERLOAD _CLC_DECL float4
-read_imagef(image2d_t image, sampler_t sampler, int2 coord);
-_CLC_OVERLOAD _CLC_DECL float4
-read_imagef(image2d_t image, sampler_t sampler, float2 coord);
-_CLC_OVERLOAD _CLC_DECL int4
-read_imagei(image2d_t image, sampler_t sampler, int2 coord);
-_CLC_OVERLOAD _CLC_DECL int4
-read_imagei(image2d_t image, sampler_t sampler, float2 coord);
-_CLC_OVERLOAD _CLC_DECL uint4
-read_imageui(image2d_t image, sampler_t sampler, int2 coord);
-_CLC_OVERLOAD _CLC_DECL uint4
-read_imageui(image2d_t image, sampler_t sampler, float2 coord);
-
-#endif

diff  --git a/libclc/generic/include/clc/image/image_defines.h b/libclc/generic/include/clc/image/image_defines.h
deleted file mode 100644
index 12fa43be82dab..0000000000000
--- a/libclc/generic/include/clc/image/image_defines.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-/* get_image_channel_data_type flags */
-#define CLK_SNORM_INT8               0x10D0
-#define CLK_SNORM_INT16              0x10D1
-#define CLK_UNORM_INT8               0x10D2
-#define CLK_UNORM_INT16              0x10D3
-#define CLK_UNORM_SHORT_565          0x10D4
-#define CLK_UNORM_SHORT_555          0x10D5
-#define CLK_UNORM_SHORT_101010       0x10D6
-#define CLK_SIGNED_INT8              0x10D7
-#define CLK_SIGNED_INT16             0x10D8
-#define CLK_SIGNED_INT32             0x10D9
-#define CLK_UNSIGNED_INT8            0x10DA
-#define CLK_UNSIGNED_INT16           0x10DB
-#define CLK_UNSIGNED_INT32           0x10DC
-#define CLK_HALF_FLOAT               0x10DD
-#define CLK_FLOAT                    0x10DE
-
-/* get_image_channel_order flags */
-#define CLK_R                        0x10B0
-#define CLK_A                        0x10B1
-#define CLK_RG                       0x10B2
-#define CLK_RA                       0x10B3
-#define CLK_RGB                      0x10B4
-#define CLK_RGBA                     0x10B5
-#define CLK_BGRA                     0x10B6
-#define CLK_ARGB                     0x10B7
-#define CLK_INTENSITY                0x10B8
-#define CLK_LUMINANCE                0x10B9
-#define CLK_Rx                       0x10BA
-#define CLK_RGx                      0x10BB
-#define CLK_RGBx                     0x10BC
-
-/* sampler normalized coords */
-#define CLK_NORMALIZED_COORDS_FALSE  0x0000
-#define CLK_NORMALIZED_COORDS_TRUE   0x0001
-#define __CLC_NORMALIZED_COORDS_MASK 0x0001
-
-/* sampler addressing mode */
-#define CLK_ADDRESS_NONE             0x0000
-#define CLK_ADDRESS_CLAMP_TO_EDGE    0x0002
-#define CLK_ADDRESS_CLAMP            0x0004
-#define CLK_ADDRESS_REPEAT           0x0006
-#define CLK_ADDRESS_MIRRORED_REPEAT  0x0008
-#define __CLC_ADDRESS_MASK           0x000E
-
-/* sampler filter mode */
-#define CLK_FILTER_NEAREST           0x0000
-#define CLK_FILTER_LINEAR            0x0010
-#define __CLC_FILTER_MASK            0x0010

diff  --git a/libclc/generic/include/clc/integer/add_sat.inc b/libclc/generic/include/clc/integer/add_sat.inc
deleted file mode 100644
index aa7de2c9ca337..0000000000000
--- a/libclc/generic/include/clc/integer/add_sat.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE add_sat(__CLC_GENTYPE x, __CLC_GENTYPE y);

diff  --git a/libclc/generic/include/clc/integer/mad_sat.inc b/libclc/generic/include/clc/integer/mad_sat.inc
deleted file mode 100644
index 4e6e0a4f19d10..0000000000000
--- a/libclc/generic/include/clc/integer/mad_sat.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mad_sat(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z);

diff  --git a/libclc/generic/include/clc/integer/rotate.inc b/libclc/generic/include/clc/integer/rotate.inc
deleted file mode 100644
index af4782ceb3b32..0000000000000
--- a/libclc/generic/include/clc/integer/rotate.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE rotate(__CLC_GENTYPE x, __CLC_GENTYPE y);

diff  --git a/libclc/generic/include/clc/integer/sub_sat.inc b/libclc/generic/include/clc/integer/sub_sat.inc
deleted file mode 100644
index 222c191bb96d5..0000000000000
--- a/libclc/generic/include/clc/integer/sub_sat.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sub_sat(__CLC_GENTYPE x, __CLC_GENTYPE y);

diff  --git a/libclc/generic/include/clc/integer/unary.inc b/libclc/generic/include/clc/integer/unary.inc
deleted file mode 100644
index 5d742de00b711..0000000000000
--- a/libclc/generic/include/clc/integer/unary.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x);

diff  --git a/libclc/generic/include/clc/math/frexp.inc b/libclc/generic/include/clc/math/frexp.inc
deleted file mode 100644
index 63fe3cb90403b..0000000000000
--- a/libclc/generic/include/clc/math/frexp.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, global __CLC_INTN *iptr);
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, local __CLC_INTN *iptr);
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, private __CLC_INTN *iptr);

diff  --git a/libclc/generic/include/clc/as_type.h b/libclc/opencl/include/clc/opencl/as_type.h
similarity index 100%
rename from libclc/generic/include/clc/as_type.h
rename to libclc/opencl/include/clc/opencl/as_type.h

diff  --git a/libclc/generic/include/clc/async/async_work_group_copy.h b/libclc/opencl/include/clc/opencl/async/async_work_group_copy.h
similarity index 74%
rename from libclc/generic/include/clc/async/async_work_group_copy.h
rename to libclc/opencl/include/clc/opencl/async/async_work_group_copy.h
index 81da21cd94d54..14420b3c9eeac 100644
--- a/libclc/generic/include/clc/async/async_work_group_copy.h
+++ b/libclc/opencl/include/clc/opencl/async/async_work_group_copy.h
@@ -8,18 +8,18 @@
 
 #define __CLC_DST_ADDR_SPACE local
 #define __CLC_SRC_ADDR_SPACE global
-#define __CLC_BODY <clc/async/async_work_group_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_copy.inc>
 #include <clc/integer/gentype.inc>
-#define __CLC_BODY <clc/async/async_work_group_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_copy.inc>
 #include <clc/math/gentype.inc>
 #undef __CLC_DST_ADDR_SPACE
 #undef __CLC_SRC_ADDR_SPACE
 
 #define __CLC_DST_ADDR_SPACE global
 #define __CLC_SRC_ADDR_SPACE local
-#define __CLC_BODY <clc/async/async_work_group_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_copy.inc>
 #include <clc/integer/gentype.inc>
-#define __CLC_BODY <clc/async/async_work_group_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_copy.inc>
 #include <clc/math/gentype.inc>
 #undef __CLC_DST_ADDR_SPACE
 #undef __CLC_SRC_ADDR_SPACE

diff  --git a/libclc/generic/include/clc/async/async_work_group_copy.inc b/libclc/opencl/include/clc/opencl/async/async_work_group_copy.inc
similarity index 62%
rename from libclc/generic/include/clc/async/async_work_group_copy.inc
rename to libclc/opencl/include/clc/opencl/async/async_work_group_copy.inc
index 502c79f410df6..cc4174970cb25 100644
--- a/libclc/generic/include/clc/async/async_work_group_copy.inc
+++ b/libclc/opencl/include/clc/opencl/async/async_work_group_copy.inc
@@ -6,8 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL event_t async_work_group_copy(
-  __CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
-  const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src,
-  size_t num_gentypes,
-  event_t event);
+_CLC_OVERLOAD _CLC_DECL event_t
+async_work_group_copy(__CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
+                      const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src,
+                      size_t num_gentypes, event_t event);

diff  --git a/libclc/generic/include/clc/async/async_work_group_strided_copy.h b/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.h
similarity index 72%
rename from libclc/generic/include/clc/async/async_work_group_strided_copy.h
rename to libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.h
index a32e958f81ced..fd37e35f18c5b 100644
--- a/libclc/generic/include/clc/async/async_work_group_strided_copy.h
+++ b/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.h
@@ -8,18 +8,18 @@
 
 #define __CLC_DST_ADDR_SPACE local
 #define __CLC_SRC_ADDR_SPACE global
-#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_strided_copy.inc>
 #include <clc/integer/gentype.inc>
-#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_strided_copy.inc>
 #include <clc/math/gentype.inc>
 #undef __CLC_DST_ADDR_SPACE
 #undef __CLC_SRC_ADDR_SPACE
 
 #define __CLC_DST_ADDR_SPACE global
 #define __CLC_SRC_ADDR_SPACE local
-#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_strided_copy.inc>
 #include <clc/integer/gentype.inc>
-#define __CLC_BODY <clc/async/async_work_group_strided_copy.inc>
+#define __CLC_BODY <clc/opencl/async/async_work_group_strided_copy.inc>
 #include <clc/math/gentype.inc>
 #undef __CLC_DST_ADDR_SPACE
 #undef __CLC_SRC_ADDR_SPACE

diff  --git a/libclc/generic/include/clc/async/async_work_group_strided_copy.inc b/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.inc
similarity index 74%
rename from libclc/generic/include/clc/async/async_work_group_strided_copy.inc
rename to libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.inc
index d5a582d9ab906..9df894e4fa29e 100644
--- a/libclc/generic/include/clc/async/async_work_group_strided_copy.inc
+++ b/libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.inc
@@ -7,8 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 _CLC_OVERLOAD _CLC_DECL event_t async_work_group_strided_copy(
-  __CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
-  const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src,
-  size_t num_gentypes,
-  size_t stride,
-  event_t event);
+    __CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst,
+    const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src, size_t num_gentypes,
+    size_t stride, event_t event);

diff  --git a/libclc/generic/include/clc/async/prefetch.h b/libclc/opencl/include/clc/opencl/async/prefetch.h
similarity index 81%
rename from libclc/generic/include/clc/async/prefetch.h
rename to libclc/opencl/include/clc/opencl/async/prefetch.h
index 01fc9215fa5e6..5075dcaee1409 100644
--- a/libclc/generic/include/clc/async/prefetch.h
+++ b/libclc/opencl/include/clc/opencl/async/prefetch.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/async/prefetch.inc>
+#define __CLC_BODY <clc/opencl/async/prefetch.inc>
 #include <clc/integer/gentype.inc>
 
-#define __CLC_BODY <clc/async/prefetch.inc>
+#define __CLC_BODY <clc/opencl/async/prefetch.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/generic/include/clc/async/prefetch.inc b/libclc/opencl/include/clc/opencl/async/prefetch.inc
similarity index 86%
rename from libclc/generic/include/clc/async/prefetch.inc
rename to libclc/opencl/include/clc/opencl/async/prefetch.inc
index 6439e721a0b3d..4a78778fa7604 100644
--- a/libclc/generic/include/clc/async/prefetch.inc
+++ b/libclc/opencl/include/clc/opencl/async/prefetch.inc
@@ -6,4 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes);
+_CLC_OVERLOAD _CLC_DECL void prefetch(const global __CLC_GENTYPE *p,
+                                      size_t num_gentypes);

diff  --git a/libclc/generic/include/clc/async/wait_group_events.h b/libclc/opencl/include/clc/opencl/async/wait_group_events.h
similarity index 100%
rename from libclc/generic/include/clc/async/wait_group_events.h
rename to libclc/opencl/include/clc/opencl/async/wait_group_events.h

diff  --git a/libclc/generic/include/clc/atomic/atom_add.h b/libclc/opencl/include/clc/opencl/atomic/atom_add.h
similarity index 83%
rename from libclc/generic/include/clc/atomic/atom_add.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_add.h
index b6eff1dea241a..62c73d99371fb 100644
--- a/libclc/generic/include/clc/atomic/atom_add.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_add.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_FUNCTION atom_add
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_base_atomics
 
 #ifdef cl_khr_local_int32_base_atomics
 #define __CLC_FUNCTION atom_add
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_base_atomics
 
 #ifdef cl_khr_int64_base_atomics
 #define __CLC_FUNCTION atom_add
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_base_atomics

diff  --git a/libclc/generic/include/clc/atomic/atom_and.h b/libclc/opencl/include/clc/opencl/atomic/atom_and.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_and.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_and.h
index 96c4ebb126daa..9dd9466f62f86 100644
--- a/libclc/generic/include/clc/atomic/atom_and.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_and.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_FUNCTION atom_and
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_extended_atomics
 
 #ifdef cl_khr_local_int32_extended_atomics
 #define __CLC_FUNCTION atom_and
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_extended_atomics
 
 #ifdef cl_khr_int64_extended_atomics
 #define __CLC_FUNCTION atom_and
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_extended_atomics

diff  --git a/libclc/generic/include/clc/atomic/atom_cmpxchg.h b/libclc/opencl/include/clc/opencl/atomic/atom_cmpxchg.h
similarity index 100%
rename from libclc/generic/include/clc/atomic/atom_cmpxchg.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_cmpxchg.h

diff  --git a/libclc/generic/include/clc/atomic/atom_dec.h b/libclc/opencl/include/clc/opencl/atomic/atom_dec.h
similarity index 100%
rename from libclc/generic/include/clc/atomic/atom_dec.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_dec.h

diff  --git a/libclc/generic/include/clc/atomic/atom_decl_int32.inc b/libclc/opencl/include/clc/opencl/atomic/atom_decl_int32.inc
similarity index 100%
rename from libclc/generic/include/clc/atomic/atom_decl_int32.inc
rename to libclc/opencl/include/clc/opencl/atomic/atom_decl_int32.inc

diff  --git a/libclc/generic/include/clc/atomic/atom_decl_int64.inc b/libclc/opencl/include/clc/opencl/atomic/atom_decl_int64.inc
similarity index 100%
rename from libclc/generic/include/clc/atomic/atom_decl_int64.inc
rename to libclc/opencl/include/clc/opencl/atomic/atom_decl_int64.inc

diff  --git a/libclc/generic/include/clc/atomic/atom_inc.h b/libclc/opencl/include/clc/opencl/atomic/atom_inc.h
similarity index 100%
rename from libclc/generic/include/clc/atomic/atom_inc.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_inc.h

diff  --git a/libclc/generic/include/clc/atomic/atom_max.h b/libclc/opencl/include/clc/opencl/atomic/atom_max.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_max.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_max.h
index 8cb601be5d6ea..00b47e6b14fde 100644
--- a/libclc/generic/include/clc/atomic/atom_max.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_max.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_FUNCTION atom_max
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_extended_atomics
 
 #ifdef cl_khr_local_int32_extended_atomics
 #define __CLC_FUNCTION atom_max
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_extended_atomics
 
 #ifdef cl_khr_int64_extended_atomics
 #define __CLC_FUNCTION atom_max
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_extended_atomics

diff  --git a/libclc/generic/include/clc/atomic/atom_min.h b/libclc/opencl/include/clc/opencl/atomic/atom_min.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_min.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_min.h
index 67853c999b2e4..40bed0dc086f2 100644
--- a/libclc/generic/include/clc/atomic/atom_min.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_min.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_FUNCTION atom_min
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_extended_atomics
 
 #ifdef cl_khr_local_int32_extended_atomics
 #define __CLC_FUNCTION atom_min
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_extended_atomics
 
 #ifdef cl_khr_int64_extended_atomics
 #define __CLC_FUNCTION atom_min
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_extended_atomics

diff  --git a/libclc/generic/include/clc/atomic/atom_or.h b/libclc/opencl/include/clc/opencl/atomic/atom_or.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_or.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_or.h
index 7930ab0c5692e..2c0beb850b4d0 100644
--- a/libclc/generic/include/clc/atomic/atom_or.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_or.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_FUNCTION atom_or
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_extended_atomics
 
 #ifdef cl_khr_local_int32_extended_atomics
 #define __CLC_FUNCTION atom_or
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_extended_atomics
 
 #ifdef cl_khr_int64_extended_atomics
 #define __CLC_FUNCTION atom_or
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_extended_atomics

diff  --git a/libclc/generic/include/clc/atomic/atom_sub.h b/libclc/opencl/include/clc/opencl/atomic/atom_sub.h
similarity index 83%
rename from libclc/generic/include/clc/atomic/atom_sub.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_sub.h
index 11eb25524c211..36074aaef5a32 100644
--- a/libclc/generic/include/clc/atomic/atom_sub.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_sub.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_FUNCTION atom_sub
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_base_atomics
 
 #ifdef cl_khr_local_int32_base_atomics
 #define __CLC_FUNCTION atom_sub
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_base_atomics
 
 #ifdef cl_khr_int64_base_atomics
 #define __CLC_FUNCTION atom_sub
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_base_atomics

diff  --git a/libclc/generic/include/clc/atomic/atom_xchg.h b/libclc/opencl/include/clc/opencl/atomic/atom_xchg.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_xchg.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_xchg.h
index 4a46536c24512..a5043aa4109ed 100644
--- a/libclc/generic/include/clc/atomic/atom_xchg.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_xchg.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_FUNCTION atom_xchg
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_base_atomics
 
 #ifdef cl_khr_local_int32_base_atomics
 #define __CLC_FUNCTION atom_xchg
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_base_atomics
 
 #ifdef cl_khr_int64_base_atomics
 #define __CLC_FUNCTION atom_xchg
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_base_atomics

diff  --git a/libclc/generic/include/clc/atomic/atom_xor.h b/libclc/opencl/include/clc/opencl/atomic/atom_xor.h
similarity index 84%
rename from libclc/generic/include/clc/atomic/atom_xor.h
rename to libclc/opencl/include/clc/opencl/atomic/atom_xor.h
index ad8ae554e15a2..0c4b456b8f23f 100644
--- a/libclc/generic/include/clc/atomic/atom_xor.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atom_xor.h
@@ -9,16 +9,16 @@
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_FUNCTION atom_xor
 #define __CLC_ADDRESS_SPACE global
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_global_int32_extended_atomics
 
 #ifdef cl_khr_local_int32_extended_atomics
 #define __CLC_FUNCTION atom_xor
 #define __CLC_ADDRESS_SPACE local
-#include <clc/atomic/atom_decl_int32.inc>
+#include <clc/opencl/atomic/atom_decl_int32.inc>
 #endif // cl_khr_local_int32_extended_atomics
 
 #ifdef cl_khr_int64_extended_atomics
 #define __CLC_FUNCTION atom_xor
-#include <clc/atomic/atom_decl_int64.inc>
+#include <clc/opencl/atomic/atom_decl_int64.inc>
 #endif // cl_khr_int64_extended_atomics

diff  --git a/libclc/generic/include/clc/atomic/atomic_add.h b/libclc/opencl/include/clc/opencl/atomic/atomic_add.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_add.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_add.h
index 59ed14557b69f..937def3f4a2ae 100644
--- a/libclc/generic/include/clc/atomic/atomic_add.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_add.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_add
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>

diff  --git a/libclc/generic/include/clc/atomic/atomic_and.h b/libclc/opencl/include/clc/opencl/atomic/atomic_and.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_and.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_and.h
index 366396a5f26a6..5f353f40318f6 100644
--- a/libclc/generic/include/clc/atomic/atomic_and.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_and.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_and
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>

diff  --git a/libclc/generic/include/clc/atomic/atomic_cmpxchg.h b/libclc/opencl/include/clc/opencl/atomic/atomic_cmpxchg.h
similarity index 58%
rename from libclc/generic/include/clc/atomic/atomic_cmpxchg.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_cmpxchg.h
index f49269777564b..fc7975910cb24 100644
--- a/libclc/generic/include/clc/atomic/atomic_cmpxchg.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_cmpxchg.h
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL int atomic_cmpxchg (volatile local int *, int, int);
-_CLC_OVERLOAD _CLC_DECL int atomic_cmpxchg (volatile global int *, int, int);
-_CLC_OVERLOAD _CLC_DECL uint atomic_cmpxchg (volatile local uint *, uint, uint);
-_CLC_OVERLOAD _CLC_DECL uint atomic_cmpxchg (volatile global uint *, uint, uint);
+_CLC_OVERLOAD _CLC_DECL int atomic_cmpxchg(volatile local int *, int, int);
+_CLC_OVERLOAD _CLC_DECL int atomic_cmpxchg(volatile global int *, int, int);
+_CLC_OVERLOAD _CLC_DECL uint atomic_cmpxchg(volatile local uint *, uint, uint);
+_CLC_OVERLOAD _CLC_DECL uint atomic_cmpxchg(volatile global uint *, uint, uint);

diff  --git a/libclc/opencl/include/clc/opencl/atomic/atomic_dec.h b/libclc/opencl/include/clc/opencl/atomic/atomic_dec.h
new file mode 100644
index 0000000000000..354a721003f56
--- /dev/null
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_dec.h
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+_CLC_OVERLOAD _CLC_DECL int atomic_dec(volatile local int *);
+_CLC_OVERLOAD _CLC_DECL int atomic_dec(volatile global int *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_dec(volatile local uint *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_dec(volatile global uint *);

diff  --git a/libclc/generic/include/clc/atomic/atomic_decl.inc b/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc
similarity index 61%
rename from libclc/generic/include/clc/atomic/atomic_decl.inc
rename to libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc
index b6540b37d1ab8..0cfd4c3eab5f6 100644
--- a/libclc/generic/include/clc/atomic/atomic_decl.inc
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_DECLARE_ATOMIC(ADDRSPACE, TYPE) \
-	_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE);
+#define __CLC_DECLARE_ATOMIC(ADDRSPACE, TYPE)                                  \
+  _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION(volatile ADDRSPACE TYPE *, TYPE);
 
-#define __CLC_DECLARE_ATOMIC_ADDRSPACE(TYPE) \
-	__CLC_DECLARE_ATOMIC(global, TYPE) \
-	__CLC_DECLARE_ATOMIC(local, TYPE)
+#define __CLC_DECLARE_ATOMIC_ADDRSPACE(TYPE)                                   \
+  __CLC_DECLARE_ATOMIC(global, TYPE)                                           \
+  __CLC_DECLARE_ATOMIC(local, TYPE)
 
 __CLC_DECLARE_ATOMIC_ADDRSPACE(int)
 __CLC_DECLARE_ATOMIC_ADDRSPACE(uint)

diff  --git a/libclc/opencl/include/clc/opencl/atomic/atomic_inc.h b/libclc/opencl/include/clc/opencl/atomic/atomic_inc.h
new file mode 100644
index 0000000000000..2b81c23bf0e5e
--- /dev/null
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_inc.h
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+_CLC_OVERLOAD _CLC_DECL int atomic_inc(volatile local int *);
+_CLC_OVERLOAD _CLC_DECL int atomic_inc(volatile global int *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_inc(volatile local uint *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_inc(volatile global uint *);

diff  --git a/libclc/generic/include/clc/atomic/atomic_max.h b/libclc/opencl/include/clc/opencl/atomic/atomic_max.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_max.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_max.h
index 4d96e948e6c8d..13832423cfeec 100644
--- a/libclc/generic/include/clc/atomic/atomic_max.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_max.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_max
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>

diff  --git a/libclc/generic/include/clc/atomic/atomic_min.h b/libclc/opencl/include/clc/opencl/atomic/atomic_min.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_min.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_min.h
index 5f3dcc4e7cdc0..3bd47a3f7837d 100644
--- a/libclc/generic/include/clc/atomic/atomic_min.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_min.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_min
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>

diff  --git a/libclc/generic/include/clc/atomic/atomic_or.h b/libclc/opencl/include/clc/opencl/atomic/atomic_or.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_or.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_or.h
index 5af595dcdd66f..13f84ea49a5ab 100644
--- a/libclc/generic/include/clc/atomic/atomic_or.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_or.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_or
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>

diff  --git a/libclc/generic/include/clc/atomic/atomic_sub.h b/libclc/opencl/include/clc/opencl/atomic/atomic_sub.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_sub.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_sub.h
index 2712a8ad2a4aa..eedc9d0e76054 100644
--- a/libclc/generic/include/clc/atomic/atomic_sub.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_sub.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_sub
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>

diff  --git a/libclc/generic/include/clc/atomic/atomic_xchg.h b/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h
similarity index 69%
rename from libclc/generic/include/clc/atomic/atomic_xchg.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h
index 050aec887b0ec..ec322d56e23d1 100644
--- a/libclc/generic/include/clc/atomic/atomic_xchg.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h
@@ -8,6 +8,6 @@
 
 #define __CLC_FUNCTION atomic_xchg
 
-_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION (volatile local float *, float);
-_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION (volatile global float *, float);
-#include <clc/atomic/atomic_decl.inc>
+_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION(volatile local float *, float);
+_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION(volatile global float *, float);
+#include <clc/opencl/atomic/atomic_decl.inc>

diff  --git a/libclc/generic/include/clc/atomic/atomic_xor.h b/libclc/opencl/include/clc/opencl/atomic/atomic_xor.h
similarity index 89%
rename from libclc/generic/include/clc/atomic/atomic_xor.h
rename to libclc/opencl/include/clc/opencl/atomic/atomic_xor.h
index 699299ca00a30..6f6b4564fdf3c 100644
--- a/libclc/generic/include/clc/atomic/atomic_xor.h
+++ b/libclc/opencl/include/clc/opencl/atomic/atomic_xor.h
@@ -7,4 +7,4 @@
 //===----------------------------------------------------------------------===//
 
 #define __CLC_FUNCTION atomic_xor
-#include <clc/atomic/atomic_decl.inc>
+#include <clc/opencl/atomic/atomic_decl.inc>

diff  --git a/libclc/opencl/include/clc/opencl/clc.h b/libclc/opencl/include/clc/opencl/clc.h
new file mode 100644
index 0000000000000..0116a12932c9f
--- /dev/null
+++ b/libclc/opencl/include/clc/opencl/clc.h
@@ -0,0 +1,267 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CLC_OPENCL_CLC_H__
+#define __CLC_OPENCL_CLC_H__
+
+#ifndef cl_clang_storage_class_specifiers
+#error Implementation requires cl_clang_storage_class_specifiers extension!
+#endif
+
+#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
+
+#ifdef cl_khr_fp64
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#endif
+
+#ifdef cl_khr_fp16
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+#endif
+
+/* Function Attributes */
+#include <clc/clcfunc.h>
+
+/* 6.1 Supported Data Types */
+#include <clc/clctypes.h>
+
+/* 6.2.3 Explicit Conversions */
+#include <clc/opencl/convert.h>
+
+/* 6.2.4.2 Reinterpreting Types Using as_type() and as_typen() */
+#include <clc/opencl/as_type.h>
+
+/* 6.11.1 Work-Item Functions */
+#include <clc/opencl/workitem/get_global_id.h>
+#include <clc/opencl/workitem/get_global_offset.h>
+#include <clc/opencl/workitem/get_global_size.h>
+#include <clc/opencl/workitem/get_group_id.h>
+#include <clc/opencl/workitem/get_local_id.h>
+#include <clc/opencl/workitem/get_local_size.h>
+#include <clc/opencl/workitem/get_num_groups.h>
+#include <clc/opencl/workitem/get_work_dim.h>
+
+/* 6.11.2 Math Functions */
+#include <clc/opencl/math/acos.h>
+#include <clc/opencl/math/acosh.h>
+#include <clc/opencl/math/acospi.h>
+#include <clc/opencl/math/asin.h>
+#include <clc/opencl/math/asinh.h>
+#include <clc/opencl/math/asinpi.h>
+#include <clc/opencl/math/atan.h>
+#include <clc/opencl/math/atan2.h>
+#include <clc/opencl/math/atan2pi.h>
+#include <clc/opencl/math/atanh.h>
+#include <clc/opencl/math/atanpi.h>
+#include <clc/opencl/math/cbrt.h>
+#include <clc/opencl/math/ceil.h>
+#include <clc/opencl/math/copysign.h>
+#include <clc/opencl/math/cos.h>
+#include <clc/opencl/math/cosh.h>
+#include <clc/opencl/math/cospi.h>
+#include <clc/opencl/math/erf.h>
+#include <clc/opencl/math/erfc.h>
+#include <clc/opencl/math/exp.h>
+#include <clc/opencl/math/exp10.h>
+#include <clc/opencl/math/exp2.h>
+#include <clc/opencl/math/expm1.h>
+#include <clc/opencl/math/fabs.h>
+#include <clc/opencl/math/fdim.h>
+#include <clc/opencl/math/floor.h>
+#include <clc/opencl/math/fma.h>
+#include <clc/opencl/math/fmax.h>
+#include <clc/opencl/math/fmin.h>
+#include <clc/opencl/math/fmod.h>
+#include <clc/opencl/math/fract.h>
+#include <clc/opencl/math/frexp.h>
+#include <clc/opencl/math/half_cos.h>
+#include <clc/opencl/math/half_divide.h>
+#include <clc/opencl/math/half_exp.h>
+#include <clc/opencl/math/half_exp10.h>
+#include <clc/opencl/math/half_exp2.h>
+#include <clc/opencl/math/half_log.h>
+#include <clc/opencl/math/half_log10.h>
+#include <clc/opencl/math/half_log2.h>
+#include <clc/opencl/math/half_powr.h>
+#include <clc/opencl/math/half_recip.h>
+#include <clc/opencl/math/half_rsqrt.h>
+#include <clc/opencl/math/half_sin.h>
+#include <clc/opencl/math/half_sqrt.h>
+#include <clc/opencl/math/half_tan.h>
+#include <clc/opencl/math/hypot.h>
+#include <clc/opencl/math/ilogb.h>
+#include <clc/opencl/math/ldexp.h>
+#include <clc/opencl/math/lgamma.h>
+#include <clc/opencl/math/lgamma_r.h>
+#include <clc/opencl/math/log.h>
+#include <clc/opencl/math/log10.h>
+#include <clc/opencl/math/log1p.h>
+#include <clc/opencl/math/log2.h>
+#include <clc/opencl/math/logb.h>
+#include <clc/opencl/math/mad.h>
+#include <clc/opencl/math/maxmag.h>
+#include <clc/opencl/math/minmag.h>
+#include <clc/opencl/math/modf.h>
+#include <clc/opencl/math/nan.h>
+#include <clc/opencl/math/native_cos.h>
+#include <clc/opencl/math/native_divide.h>
+#include <clc/opencl/math/native_exp.h>
+#include <clc/opencl/math/native_exp10.h>
+#include <clc/opencl/math/native_exp2.h>
+#include <clc/opencl/math/native_log.h>
+#include <clc/opencl/math/native_log10.h>
+#include <clc/opencl/math/native_log2.h>
+#include <clc/opencl/math/native_powr.h>
+#include <clc/opencl/math/native_recip.h>
+#include <clc/opencl/math/native_rsqrt.h>
+#include <clc/opencl/math/native_sin.h>
+#include <clc/opencl/math/native_sqrt.h>
+#include <clc/opencl/math/native_tan.h>
+#include <clc/opencl/math/nextafter.h>
+#include <clc/opencl/math/pow.h>
+#include <clc/opencl/math/pown.h>
+#include <clc/opencl/math/powr.h>
+#include <clc/opencl/math/remainder.h>
+#include <clc/opencl/math/remquo.h>
+#include <clc/opencl/math/rint.h>
+#include <clc/opencl/math/rootn.h>
+#include <clc/opencl/math/round.h>
+#include <clc/opencl/math/rsqrt.h>
+#include <clc/opencl/math/sin.h>
+#include <clc/opencl/math/sincos.h>
+#include <clc/opencl/math/sinh.h>
+#include <clc/opencl/math/sinpi.h>
+#include <clc/opencl/math/sqrt.h>
+#include <clc/opencl/math/tan.h>
+#include <clc/opencl/math/tanh.h>
+#include <clc/opencl/math/tanpi.h>
+#include <clc/opencl/math/tgamma.h>
+#include <clc/opencl/math/trunc.h>
+
+/* 6.11.2.1 Floating-point macros */
+#include <clc/float/definitions.h>
+
+/* 6.11.3 Integer Functions */
+#include <clc/opencl/integer/abs.h>
+#include <clc/opencl/integer/abs_
diff .h>
+#include <clc/opencl/integer/add_sat.h>
+#include <clc/opencl/integer/clz.h>
+#include <clc/opencl/integer/ctz.h>
+#include <clc/opencl/integer/hadd.h>
+#include <clc/opencl/integer/mad24.h>
+#include <clc/opencl/integer/mad_hi.h>
+#include <clc/opencl/integer/mad_sat.h>
+#include <clc/opencl/integer/mul24.h>
+#include <clc/opencl/integer/mul_hi.h>
+#include <clc/opencl/integer/popcount.h>
+#include <clc/opencl/integer/rhadd.h>
+#include <clc/opencl/integer/rotate.h>
+#include <clc/opencl/integer/sub_sat.h>
+#include <clc/opencl/integer/upsample.h>
+
+/* 6.11.3 Integer Definitions */
+#include <clc/integer/definitions.h>
+
+/* 6.11.2 and 6.11.3 Shared Integer/Math Functions */
+#include <clc/opencl/shared/clamp.h>
+#include <clc/opencl/shared/max.h>
+#include <clc/opencl/shared/min.h>
+#include <clc/opencl/shared/vload.h>
+#include <clc/opencl/shared/vstore.h>
+
+/* 6.11.4 Common Functions */
+#include <clc/opencl/common/degrees.h>
+#include <clc/opencl/common/mix.h>
+#include <clc/opencl/common/radians.h>
+#include <clc/opencl/common/sign.h>
+#include <clc/opencl/common/smoothstep.h>
+#include <clc/opencl/common/step.h>
+
+/* 6.11.5 Geometric Functions */
+#include <clc/opencl/geometric/cross.h>
+#include <clc/opencl/geometric/distance.h>
+#include <clc/opencl/geometric/dot.h>
+#include <clc/opencl/geometric/fast_distance.h>
+#include <clc/opencl/geometric/fast_length.h>
+#include <clc/opencl/geometric/fast_normalize.h>
+#include <clc/opencl/geometric/length.h>
+#include <clc/opencl/geometric/normalize.h>
+
+/* 6.11.6 Relational Functions */
+#include <clc/opencl/relational/all.h>
+#include <clc/opencl/relational/any.h>
+#include <clc/opencl/relational/bitselect.h>
+#include <clc/opencl/relational/isequal.h>
+#include <clc/opencl/relational/isfinite.h>
+#include <clc/opencl/relational/isgreater.h>
+#include <clc/opencl/relational/isgreaterequal.h>
+#include <clc/opencl/relational/isinf.h>
+#include <clc/opencl/relational/isless.h>
+#include <clc/opencl/relational/islessequal.h>
+#include <clc/opencl/relational/islessgreater.h>
+#include <clc/opencl/relational/isnan.h>
+#include <clc/opencl/relational/isnormal.h>
+#include <clc/opencl/relational/isnotequal.h>
+#include <clc/opencl/relational/isordered.h>
+#include <clc/opencl/relational/isunordered.h>
+#include <clc/opencl/relational/select.h>
+#include <clc/opencl/relational/signbit.h>
+
+/* 6.11.8 Synchronization Functions */
+#include <clc/opencl/synchronization/barrier.h>
+#include <clc/opencl/synchronization/cl_mem_fence_flags.h>
+
+/* 6.11.9 Explicit Memory Fence Functions */
+#include <clc/opencl/explicit_fence/explicit_memory_fence.h>
+
+/* 6.11.10 Async Copy and Prefetch Functions */
+#include <clc/opencl/async/async_work_group_copy.h>
+#include <clc/opencl/async/async_work_group_strided_copy.h>
+#include <clc/opencl/async/prefetch.h>
+#include <clc/opencl/async/wait_group_events.h>
+
+/* 6.11.11 Atomic Functions */
+#include <clc/opencl/atomic/atomic_add.h>
+#include <clc/opencl/atomic/atomic_and.h>
+#include <clc/opencl/atomic/atomic_cmpxchg.h>
+#include <clc/opencl/atomic/atomic_dec.h>
+#include <clc/opencl/atomic/atomic_inc.h>
+#include <clc/opencl/atomic/atomic_max.h>
+#include <clc/opencl/atomic/atomic_min.h>
+#include <clc/opencl/atomic/atomic_or.h>
+#include <clc/opencl/atomic/atomic_sub.h>
+#include <clc/opencl/atomic/atomic_xchg.h>
+#include <clc/opencl/atomic/atomic_xor.h>
+
+/* cl_khr_global_int32_base_atomics, cl_khr_local_int32_base_atomics and
+ * cl_khr_int64_base_atomics Extension Functions */
+#include <clc/opencl/atomic/atom_add.h>
+#include <clc/opencl/atomic/atom_cmpxchg.h>
+#include <clc/opencl/atomic/atom_dec.h>
+#include <clc/opencl/atomic/atom_inc.h>
+#include <clc/opencl/atomic/atom_sub.h>
+#include <clc/opencl/atomic/atom_xchg.h>
+
+/* cl_khr_global_int32_extended_atomics, cl_khr_local_int32_extended_atomics and
+ * cl_khr_int64_extended_atomics Extension Functions */
+#include <clc/opencl/atomic/atom_and.h>
+#include <clc/opencl/atomic/atom_max.h>
+#include <clc/opencl/atomic/atom_min.h>
+#include <clc/opencl/atomic/atom_or.h>
+#include <clc/opencl/atomic/atom_xor.h>
+
+/* 6.12.12 Miscellaneous Vector Functions */
+#include <clc/opencl/misc/shuffle.h>
+#include <clc/opencl/misc/shuffle2.h>
+
+/* 6.11.13 Image Read and Write Functions */
+#include <clc/opencl/image/image.h>
+#include <clc/opencl/image/image_defines.h>
+
+#pragma OPENCL EXTENSION all : disable
+
+#endif // __CLC_OPENCL_CLC_H__

diff  --git a/libclc/generic/include/clc/common/degrees.h b/libclc/opencl/include/clc/opencl/common/degrees.h
similarity index 80%
rename from libclc/generic/include/clc/common/degrees.h
rename to libclc/opencl/include/clc/opencl/common/degrees.h
index b895a4cbeeeb7..f442c5fbda857 100644
--- a/libclc/generic/include/clc/common/degrees.h
+++ b/libclc/opencl/include/clc/opencl/common/degrees.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/common/degrees.inc>
+#define __CLC_FUNCTION degrees
+#define __CLC_BODY <clc/math/unary_decl.inc>
+
 #include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION

diff  --git a/libclc/generic/include/clc/common/mix.h b/libclc/opencl/include/clc/opencl/common/mix.h
similarity index 89%
rename from libclc/generic/include/clc/common/mix.h
rename to libclc/opencl/include/clc/opencl/common/mix.h
index 51504282c1ae4..76aeaaba665ac 100644
--- a/libclc/generic/include/clc/common/mix.h
+++ b/libclc/opencl/include/clc/opencl/common/mix.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/common/mix.inc>
+#define __CLC_BODY <clc/opencl/common/mix.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/generic/include/clc/common/mix.inc b/libclc/opencl/include/clc/opencl/common/mix.inc
similarity index 77%
rename from libclc/generic/include/clc/common/mix.inc
rename to libclc/opencl/include/clc/opencl/common/mix.inc
index 87167fcd19ec3..2b8350f5baae1 100644
--- a/libclc/generic/include/clc/common/mix.inc
+++ b/libclc/opencl/include/clc/opencl/common/mix.inc
@@ -6,8 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b,
+                                          __CLC_GENTYPE c);
 
 #ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_SCALAR_GENTYPE c);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b,
+                                          __CLC_SCALAR_GENTYPE c);
 #endif

diff  --git a/libclc/generic/include/clc/common/radians.h b/libclc/opencl/include/clc/opencl/common/radians.h
similarity index 80%
rename from libclc/generic/include/clc/common/radians.h
rename to libclc/opencl/include/clc/opencl/common/radians.h
index f683e97778f28..2772f7c2f0ae8 100644
--- a/libclc/generic/include/clc/common/radians.h
+++ b/libclc/opencl/include/clc/opencl/common/radians.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/common/radians.inc>
+#define __CLC_FUNCTION radians
+#define __CLC_BODY <clc/math/unary_decl.inc>
+
 #include <clc/math/gentype.inc>
+
+#undef __CLC_FUNCTION

diff  --git a/libclc/generic/include/clc/common/sign.h b/libclc/opencl/include/clc/opencl/common/sign.h
similarity index 100%
rename from libclc/generic/include/clc/common/sign.h
rename to libclc/opencl/include/clc/opencl/common/sign.h

diff  --git a/libclc/generic/include/clc/common/smoothstep.h b/libclc/opencl/include/clc/opencl/common/smoothstep.h
similarity index 88%
rename from libclc/generic/include/clc/common/smoothstep.h
rename to libclc/opencl/include/clc/opencl/common/smoothstep.h
index 05c3a51ccddb1..87a642f8947a1 100644
--- a/libclc/generic/include/clc/common/smoothstep.h
+++ b/libclc/opencl/include/clc/opencl/common/smoothstep.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/common/smoothstep.inc>
+#define __CLC_BODY <clc/opencl/common/smoothstep.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/generic/include/clc/common/smoothstep.inc b/libclc/opencl/include/clc/opencl/common/smoothstep.inc
similarity index 66%
rename from libclc/generic/include/clc/common/smoothstep.inc
rename to libclc/opencl/include/clc/opencl/common/smoothstep.inc
index 2efaa2494c85d..4547483364ba2 100644
--- a/libclc/generic/include/clc/common/smoothstep.inc
+++ b/libclc/opencl/include/clc/opencl/common/smoothstep.inc
@@ -6,9 +6,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(__CLC_GENTYPE edge0, __CLC_GENTYPE edge1, __CLC_GENTYPE x);
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(float edge0, float edge1, __CLC_GENTYPE x);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(__CLC_GENTYPE edge0,
+                                                 __CLC_GENTYPE edge1,
+                                                 __CLC_GENTYPE x);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(float edge0, float edge1,
+                                                 __CLC_GENTYPE x);
 
 #ifdef cl_khr_fp64
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(double edge0, double edge1, __CLC_GENTYPE x);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(double edge0, double edge1,
+                                                 __CLC_GENTYPE x);
 #endif

diff  --git a/libclc/generic/include/clc/common/step.h b/libclc/opencl/include/clc/opencl/common/step.h
similarity index 89%
rename from libclc/generic/include/clc/common/step.h
rename to libclc/opencl/include/clc/opencl/common/step.h
index 8c663c981975d..d25a66f16ac3a 100644
--- a/libclc/generic/include/clc/common/step.h
+++ b/libclc/opencl/include/clc/opencl/common/step.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/common/step.inc>
+#define __CLC_BODY <clc/opencl/common/step.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/generic/include/clc/common/step.inc b/libclc/opencl/include/clc/opencl/common/step.inc
similarity index 100%
rename from libclc/generic/include/clc/common/step.inc
rename to libclc/opencl/include/clc/opencl/common/step.inc

diff  --git a/libclc/generic/include/clc/convert.h b/libclc/opencl/include/clc/opencl/convert.h
similarity index 100%
rename from libclc/generic/include/clc/convert.h
rename to libclc/opencl/include/clc/opencl/convert.h

diff  --git a/libclc/generic/include/clc/explicit_fence/explicit_memory_fence.h b/libclc/opencl/include/clc/opencl/explicit_fence/explicit_memory_fence.h
similarity index 100%
rename from libclc/generic/include/clc/explicit_fence/explicit_memory_fence.h
rename to libclc/opencl/include/clc/opencl/explicit_fence/explicit_memory_fence.h

diff  --git a/libclc/generic/include/clc/geometric/cross.h b/libclc/opencl/include/clc/opencl/geometric/cross.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/cross.h
rename to libclc/opencl/include/clc/opencl/geometric/cross.h

diff  --git a/libclc/generic/include/clc/geometric/distance.h b/libclc/opencl/include/clc/opencl/geometric/distance.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/distance.h
rename to libclc/opencl/include/clc/opencl/geometric/distance.h

diff  --git a/libclc/generic/include/clc/geometric/dot.h b/libclc/opencl/include/clc/opencl/geometric/dot.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/dot.h
rename to libclc/opencl/include/clc/opencl/geometric/dot.h

diff  --git a/libclc/generic/include/clc/geometric/fast_distance.h b/libclc/opencl/include/clc/opencl/geometric/fast_distance.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/fast_distance.h
rename to libclc/opencl/include/clc/opencl/geometric/fast_distance.h

diff  --git a/libclc/generic/include/clc/geometric/fast_length.h b/libclc/opencl/include/clc/opencl/geometric/fast_length.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/fast_length.h
rename to libclc/opencl/include/clc/opencl/geometric/fast_length.h

diff  --git a/libclc/generic/include/clc/geometric/fast_normalize.h b/libclc/opencl/include/clc/opencl/geometric/fast_normalize.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/fast_normalize.h
rename to libclc/opencl/include/clc/opencl/geometric/fast_normalize.h

diff  --git a/libclc/generic/include/clc/geometric/length.h b/libclc/opencl/include/clc/opencl/geometric/length.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/length.h
rename to libclc/opencl/include/clc/opencl/geometric/length.h

diff  --git a/libclc/generic/include/clc/geometric/normalize.h b/libclc/opencl/include/clc/opencl/geometric/normalize.h
similarity index 100%
rename from libclc/generic/include/clc/geometric/normalize.h
rename to libclc/opencl/include/clc/opencl/geometric/normalize.h

diff  --git a/libclc/opencl/include/clc/opencl/image/image.h b/libclc/opencl/include/clc/opencl/image/image.h
new file mode 100644
index 0000000000000..6435f3430e2fe
--- /dev/null
+++ b/libclc/opencl/include/clc/opencl/image/image.h
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#if defined(__opencl_c_images)
+
+_CLC_OVERLOAD _CLC_DECL int get_image_width(image2d_t image);
+_CLC_OVERLOAD _CLC_DECL int get_image_width(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL int get_image_height(image2d_t image);
+_CLC_OVERLOAD _CLC_DECL int get_image_height(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL int get_image_depth(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type(image2d_t image);
+_CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL int get_image_channel_order(image2d_t image);
+_CLC_OVERLOAD _CLC_DECL int get_image_channel_order(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL int2 get_image_dim(image2d_t image);
+_CLC_OVERLOAD _CLC_DECL int4 get_image_dim(image3d_t image);
+
+_CLC_OVERLOAD _CLC_DECL void write_imagef(image2d_t image, int2 coord,
+                                          float4 color);
+_CLC_OVERLOAD _CLC_DECL void write_imagei(image2d_t image, int2 coord,
+                                          int4 color);
+_CLC_OVERLOAD _CLC_DECL void write_imageui(image2d_t image, int2 coord,
+                                           uint4 color);
+
+_CLC_OVERLOAD _CLC_DECL float4 read_imagef(image2d_t image, sampler_t sampler,
+                                           int2 coord);
+_CLC_OVERLOAD _CLC_DECL float4 read_imagef(image2d_t image, sampler_t sampler,
+                                           float2 coord);
+_CLC_OVERLOAD _CLC_DECL int4 read_imagei(image2d_t image, sampler_t sampler,
+                                         int2 coord);
+_CLC_OVERLOAD _CLC_DECL int4 read_imagei(image2d_t image, sampler_t sampler,
+                                         float2 coord);
+_CLC_OVERLOAD _CLC_DECL uint4 read_imageui(image2d_t image, sampler_t sampler,
+                                           int2 coord);
+_CLC_OVERLOAD _CLC_DECL uint4 read_imageui(image2d_t image, sampler_t sampler,
+                                           float2 coord);
+
+#endif

diff  --git a/libclc/opencl/include/clc/opencl/image/image_defines.h b/libclc/opencl/include/clc/opencl/image/image_defines.h
new file mode 100644
index 0000000000000..f3589fdc4a89a
--- /dev/null
+++ b/libclc/opencl/include/clc/opencl/image/image_defines.h
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+/* get_image_channel_data_type flags */
+#define CLK_SNORM_INT8 0x10D0
+#define CLK_SNORM_INT16 0x10D1
+#define CLK_UNORM_INT8 0x10D2
+#define CLK_UNORM_INT16 0x10D3
+#define CLK_UNORM_SHORT_565 0x10D4
+#define CLK_UNORM_SHORT_555 0x10D5
+#define CLK_UNORM_SHORT_101010 0x10D6
+#define CLK_SIGNED_INT8 0x10D7
+#define CLK_SIGNED_INT16 0x10D8
+#define CLK_SIGNED_INT32 0x10D9
+#define CLK_UNSIGNED_INT8 0x10DA
+#define CLK_UNSIGNED_INT16 0x10DB
+#define CLK_UNSIGNED_INT32 0x10DC
+#define CLK_HALF_FLOAT 0x10DD
+#define CLK_FLOAT 0x10DE
+
+/* get_image_channel_order flags */
+#define CLK_R 0x10B0
+#define CLK_A 0x10B1
+#define CLK_RG 0x10B2
+#define CLK_RA 0x10B3
+#define CLK_RGB 0x10B4
+#define CLK_RGBA 0x10B5
+#define CLK_BGRA 0x10B6
+#define CLK_ARGB 0x10B7
+#define CLK_INTENSITY 0x10B8
+#define CLK_LUMINANCE 0x10B9
+#define CLK_Rx 0x10BA
+#define CLK_RGx 0x10BB
+#define CLK_RGBx 0x10BC
+
+/* sampler normalized coords */
+#define CLK_NORMALIZED_COORDS_FALSE 0x0000
+#define CLK_NORMALIZED_COORDS_TRUE 0x0001
+#define __CLC_NORMALIZED_COORDS_MASK 0x0001
+
+/* sampler addressing mode */
+#define CLK_ADDRESS_NONE 0x0000
+#define CLK_ADDRESS_CLAMP_TO_EDGE 0x0002
+#define CLK_ADDRESS_CLAMP 0x0004
+#define CLK_ADDRESS_REPEAT 0x0006
+#define CLK_ADDRESS_MIRRORED_REPEAT 0x0008
+#define __CLC_ADDRESS_MASK 0x000E
+
+/* sampler filter mode */
+#define CLK_FILTER_NEAREST 0x0000
+#define CLK_FILTER_LINEAR 0x0010
+#define __CLC_FILTER_MASK 0x0010

diff  --git a/libclc/generic/include/clc/integer/abs.h b/libclc/opencl/include/clc/opencl/integer/abs.h
similarity index 89%
rename from libclc/generic/include/clc/integer/abs.h
rename to libclc/opencl/include/clc/opencl/integer/abs.h
index df5e23e08d8c6..22ba40fb40d42 100644
--- a/libclc/generic/include/clc/integer/abs.h
+++ b/libclc/opencl/include/clc/opencl/integer/abs.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/abs.inc>
+#define __CLC_BODY <clc/opencl/integer/abs.inc>
 #include <clc/integer/gentype.inc>

diff  --git a/libclc/generic/include/clc/integer/abs.inc b/libclc/opencl/include/clc/opencl/integer/abs.inc
similarity index 100%
rename from libclc/generic/include/clc/integer/abs.inc
rename to libclc/opencl/include/clc/opencl/integer/abs.inc

diff  --git a/libclc/generic/include/clc/integer/abs_
diff .h b/libclc/opencl/include/clc/opencl/integer/abs_
diff .h
similarity index 88%
rename from libclc/generic/include/clc/integer/abs_
diff .h
rename to libclc/opencl/include/clc/opencl/integer/abs_
diff .h
index 0005e0da7645e..f22cc4d88afcf 100644
--- a/libclc/generic/include/clc/integer/abs_
diff .h
+++ b/libclc/opencl/include/clc/opencl/integer/abs_
diff .h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/abs_
diff .inc>
+#define __CLC_BODY <clc/opencl/integer/abs_
diff .inc>
 #include <clc/integer/gentype.inc>

diff  --git a/libclc/generic/include/clc/integer/abs_
diff .inc b/libclc/opencl/include/clc/opencl/integer/abs_
diff .inc
similarity index 86%
rename from libclc/generic/include/clc/integer/abs_
diff .inc
rename to libclc/opencl/include/clc/opencl/integer/abs_
diff .inc
index e99f9d686bbed..41873854021eb 100644
--- a/libclc/generic/include/clc/integer/abs_
diff .inc
+++ b/libclc/opencl/include/clc/opencl/integer/abs_
diff .inc
@@ -6,4 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_U_GENTYPE abs_
diff (__CLC_GENTYPE x, __CLC_GENTYPE y);
+_CLC_OVERLOAD _CLC_DECL __CLC_U_GENTYPE abs_
diff (__CLC_GENTYPE x,
+                                                 __CLC_GENTYPE y);

diff  --git a/libclc/generic/include/clc/integer/add_sat.h b/libclc/opencl/include/clc/opencl/integer/add_sat.h
similarity index 79%
rename from libclc/generic/include/clc/integer/add_sat.h
rename to libclc/opencl/include/clc/opencl/integer/add_sat.h
index 9ef8affd9fc62..1982d11908008 100644
--- a/libclc/generic/include/clc/integer/add_sat.h
+++ b/libclc/opencl/include/clc/opencl/integer/add_sat.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/add_sat.inc>
+#define __CLC_FUNCTION add_sat
+#define __CLC_BODY <clc/shared/binary_decl.inc>
+
 #include <clc/integer/gentype.inc>
+
+#undef __CLC_FUNCTION

diff  --git a/libclc/generic/include/clc/integer/clz.h b/libclc/opencl/include/clc/opencl/integer/clz.h
similarity index 100%
rename from libclc/generic/include/clc/integer/clz.h
rename to libclc/opencl/include/clc/opencl/integer/clz.h

diff  --git a/libclc/generic/include/clc/integer/ctz.h b/libclc/opencl/include/clc/opencl/integer/ctz.h
similarity index 100%
rename from libclc/generic/include/clc/integer/ctz.h
rename to libclc/opencl/include/clc/opencl/integer/ctz.h

diff  --git a/libclc/generic/include/clc/integer/hadd.h b/libclc/opencl/include/clc/opencl/integer/hadd.h
similarity index 100%
rename from libclc/generic/include/clc/integer/hadd.h
rename to libclc/opencl/include/clc/opencl/integer/hadd.h

diff  --git a/libclc/generic/include/clc/integer/mad24.h b/libclc/opencl/include/clc/opencl/integer/mad24.h
similarity index 100%
rename from libclc/generic/include/clc/integer/mad24.h
rename to libclc/opencl/include/clc/opencl/integer/mad24.h

diff  --git a/libclc/generic/include/clc/integer/mad_hi.h b/libclc/opencl/include/clc/opencl/integer/mad_hi.h
similarity index 100%
rename from libclc/generic/include/clc/integer/mad_hi.h
rename to libclc/opencl/include/clc/opencl/integer/mad_hi.h

diff  --git a/libclc/generic/include/clc/integer/mad_sat.h b/libclc/opencl/include/clc/opencl/integer/mad_sat.h
similarity index 79%
rename from libclc/generic/include/clc/integer/mad_sat.h
rename to libclc/opencl/include/clc/opencl/integer/mad_sat.h
index e404b6438dfbc..0a9fd7869a6f4 100644
--- a/libclc/generic/include/clc/integer/mad_sat.h
+++ b/libclc/opencl/include/clc/opencl/integer/mad_sat.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/mad_sat.inc>
+#define __CLC_FUNCTION mad_sat
+#define __CLC_BODY <clc/shared/ternary_decl.inc>
+
 #include <clc/integer/gentype.inc>
+
+#undef __CLC_FUNCTION

diff  --git a/libclc/generic/include/clc/integer/mul24.h b/libclc/opencl/include/clc/opencl/integer/mul24.h
similarity index 100%
rename from libclc/generic/include/clc/integer/mul24.h
rename to libclc/opencl/include/clc/opencl/integer/mul24.h

diff  --git a/libclc/generic/include/clc/integer/mul_hi.h b/libclc/opencl/include/clc/opencl/integer/mul_hi.h
similarity index 100%
rename from libclc/generic/include/clc/integer/mul_hi.h
rename to libclc/opencl/include/clc/opencl/integer/mul_hi.h

diff  --git a/libclc/generic/include/clc/integer/popcount.h b/libclc/opencl/include/clc/opencl/integer/popcount.h
similarity index 100%
rename from libclc/generic/include/clc/integer/popcount.h
rename to libclc/opencl/include/clc/opencl/integer/popcount.h

diff  --git a/libclc/generic/include/clc/integer/rhadd.h b/libclc/opencl/include/clc/opencl/integer/rhadd.h
similarity index 100%
rename from libclc/generic/include/clc/integer/rhadd.h
rename to libclc/opencl/include/clc/opencl/integer/rhadd.h

diff  --git a/libclc/generic/include/clc/integer/rotate.h b/libclc/opencl/include/clc/opencl/integer/rotate.h
similarity index 79%
rename from libclc/generic/include/clc/integer/rotate.h
rename to libclc/opencl/include/clc/opencl/integer/rotate.h
index 9209f6e6ab320..1e4de24cbf313 100644
--- a/libclc/generic/include/clc/integer/rotate.h
+++ b/libclc/opencl/include/clc/opencl/integer/rotate.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/rotate.inc>
+#define __CLC_FUNCTION rotate
+#define __CLC_BODY <clc/shared/binary_decl.inc>
+
 #include <clc/integer/gentype.inc>
+
+#undef __CLC_FUNCTION

diff  --git a/libclc/generic/include/clc/integer/sub_sat.h b/libclc/opencl/include/clc/opencl/integer/sub_sat.h
similarity index 79%
rename from libclc/generic/include/clc/integer/sub_sat.h
rename to libclc/opencl/include/clc/opencl/integer/sub_sat.h
index 6a30bd110ae71..ee5d8c78f3ebe 100644
--- a/libclc/generic/include/clc/integer/sub_sat.h
+++ b/libclc/opencl/include/clc/opencl/integer/sub_sat.h
@@ -6,5 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/integer/sub_sat.inc>
+#define __CLC_FUNCTION sub_sat
+#define __CLC_BODY <clc/shared/binary_decl.inc>
+
 #include <clc/integer/gentype.inc>
+
+#undef __CLC_FUNCTION

diff  --git a/libclc/generic/include/clc/integer/upsample.h b/libclc/opencl/include/clc/opencl/integer/upsample.h
similarity index 100%
rename from libclc/generic/include/clc/integer/upsample.h
rename to libclc/opencl/include/clc/opencl/integer/upsample.h

diff  --git a/libclc/generic/include/clc/math/acos.h b/libclc/opencl/include/clc/opencl/math/acos.h
similarity index 100%
rename from libclc/generic/include/clc/math/acos.h
rename to libclc/opencl/include/clc/opencl/math/acos.h

diff  --git a/libclc/generic/include/clc/math/acosh.h b/libclc/opencl/include/clc/opencl/math/acosh.h
similarity index 100%
rename from libclc/generic/include/clc/math/acosh.h
rename to libclc/opencl/include/clc/opencl/math/acosh.h

diff  --git a/libclc/generic/include/clc/math/acospi.h b/libclc/opencl/include/clc/opencl/math/acospi.h
similarity index 100%
rename from libclc/generic/include/clc/math/acospi.h
rename to libclc/opencl/include/clc/opencl/math/acospi.h

diff  --git a/libclc/generic/include/clc/math/asin.h b/libclc/opencl/include/clc/opencl/math/asin.h
similarity index 100%
rename from libclc/generic/include/clc/math/asin.h
rename to libclc/opencl/include/clc/opencl/math/asin.h

diff  --git a/libclc/generic/include/clc/math/asinh.h b/libclc/opencl/include/clc/opencl/math/asinh.h
similarity index 100%
rename from libclc/generic/include/clc/math/asinh.h
rename to libclc/opencl/include/clc/opencl/math/asinh.h

diff  --git a/libclc/generic/include/clc/math/asinpi.h b/libclc/opencl/include/clc/opencl/math/asinpi.h
similarity index 100%
rename from libclc/generic/include/clc/math/asinpi.h
rename to libclc/opencl/include/clc/opencl/math/asinpi.h

diff  --git a/libclc/generic/include/clc/math/atan.h b/libclc/opencl/include/clc/opencl/math/atan.h
similarity index 100%
rename from libclc/generic/include/clc/math/atan.h
rename to libclc/opencl/include/clc/opencl/math/atan.h

diff  --git a/libclc/generic/include/clc/math/atan2.h b/libclc/opencl/include/clc/opencl/math/atan2.h
similarity index 100%
rename from libclc/generic/include/clc/math/atan2.h
rename to libclc/opencl/include/clc/opencl/math/atan2.h

diff  --git a/libclc/generic/include/clc/math/atan2pi.h b/libclc/opencl/include/clc/opencl/math/atan2pi.h
similarity index 100%
rename from libclc/generic/include/clc/math/atan2pi.h
rename to libclc/opencl/include/clc/opencl/math/atan2pi.h

diff  --git a/libclc/generic/include/clc/math/atanh.h b/libclc/opencl/include/clc/opencl/math/atanh.h
similarity index 100%
rename from libclc/generic/include/clc/math/atanh.h
rename to libclc/opencl/include/clc/opencl/math/atanh.h

diff  --git a/libclc/generic/include/clc/math/atanpi.h b/libclc/opencl/include/clc/opencl/math/atanpi.h
similarity index 100%
rename from libclc/generic/include/clc/math/atanpi.h
rename to libclc/opencl/include/clc/opencl/math/atanpi.h

diff  --git a/libclc/generic/include/clc/math/cbrt.h b/libclc/opencl/include/clc/opencl/math/cbrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/cbrt.h
rename to libclc/opencl/include/clc/opencl/math/cbrt.h

diff  --git a/libclc/generic/include/clc/math/ceil.h b/libclc/opencl/include/clc/opencl/math/ceil.h
similarity index 100%
rename from libclc/generic/include/clc/math/ceil.h
rename to libclc/opencl/include/clc/opencl/math/ceil.h

diff  --git a/libclc/generic/include/clc/math/copysign.h b/libclc/opencl/include/clc/opencl/math/copysign.h
similarity index 100%
rename from libclc/generic/include/clc/math/copysign.h
rename to libclc/opencl/include/clc/opencl/math/copysign.h

diff  --git a/libclc/generic/include/clc/math/cos.h b/libclc/opencl/include/clc/opencl/math/cos.h
similarity index 100%
rename from libclc/generic/include/clc/math/cos.h
rename to libclc/opencl/include/clc/opencl/math/cos.h

diff  --git a/libclc/generic/include/clc/math/cosh.h b/libclc/opencl/include/clc/opencl/math/cosh.h
similarity index 100%
rename from libclc/generic/include/clc/math/cosh.h
rename to libclc/opencl/include/clc/opencl/math/cosh.h

diff  --git a/libclc/generic/include/clc/math/cospi.h b/libclc/opencl/include/clc/opencl/math/cospi.h
similarity index 100%
rename from libclc/generic/include/clc/math/cospi.h
rename to libclc/opencl/include/clc/opencl/math/cospi.h

diff  --git a/libclc/generic/include/clc/math/erf.h b/libclc/opencl/include/clc/opencl/math/erf.h
similarity index 100%
rename from libclc/generic/include/clc/math/erf.h
rename to libclc/opencl/include/clc/opencl/math/erf.h

diff  --git a/libclc/generic/include/clc/math/erfc.h b/libclc/opencl/include/clc/opencl/math/erfc.h
similarity index 100%
rename from libclc/generic/include/clc/math/erfc.h
rename to libclc/opencl/include/clc/opencl/math/erfc.h

diff  --git a/libclc/generic/include/clc/math/exp.h b/libclc/opencl/include/clc/opencl/math/exp.h
similarity index 100%
rename from libclc/generic/include/clc/math/exp.h
rename to libclc/opencl/include/clc/opencl/math/exp.h

diff  --git a/libclc/generic/include/clc/math/exp10.h b/libclc/opencl/include/clc/opencl/math/exp10.h
similarity index 100%
rename from libclc/generic/include/clc/math/exp10.h
rename to libclc/opencl/include/clc/opencl/math/exp10.h

diff  --git a/libclc/generic/include/clc/math/exp2.h b/libclc/opencl/include/clc/opencl/math/exp2.h
similarity index 100%
rename from libclc/generic/include/clc/math/exp2.h
rename to libclc/opencl/include/clc/opencl/math/exp2.h

diff  --git a/libclc/generic/include/clc/math/expm1.h b/libclc/opencl/include/clc/opencl/math/expm1.h
similarity index 100%
rename from libclc/generic/include/clc/math/expm1.h
rename to libclc/opencl/include/clc/opencl/math/expm1.h

diff  --git a/libclc/generic/include/clc/math/fabs.h b/libclc/opencl/include/clc/opencl/math/fabs.h
similarity index 100%
rename from libclc/generic/include/clc/math/fabs.h
rename to libclc/opencl/include/clc/opencl/math/fabs.h

diff  --git a/libclc/generic/include/clc/math/fdim.h b/libclc/opencl/include/clc/opencl/math/fdim.h
similarity index 100%
rename from libclc/generic/include/clc/math/fdim.h
rename to libclc/opencl/include/clc/opencl/math/fdim.h

diff  --git a/libclc/generic/include/clc/math/floor.h b/libclc/opencl/include/clc/opencl/math/floor.h
similarity index 100%
rename from libclc/generic/include/clc/math/floor.h
rename to libclc/opencl/include/clc/opencl/math/floor.h

diff  --git a/libclc/generic/include/clc/math/fma.h b/libclc/opencl/include/clc/opencl/math/fma.h
similarity index 100%
rename from libclc/generic/include/clc/math/fma.h
rename to libclc/opencl/include/clc/opencl/math/fma.h

diff  --git a/libclc/generic/include/clc/math/fmax.h b/libclc/opencl/include/clc/opencl/math/fmax.h
similarity index 99%
rename from libclc/generic/include/clc/math/fmax.h
rename to libclc/opencl/include/clc/opencl/math/fmax.h
index 6c943370e28da..2144bb334f1ae 100644
--- a/libclc/generic/include/clc/math/fmax.h
+++ b/libclc/opencl/include/clc/opencl/math/fmax.h
@@ -12,4 +12,3 @@
 #include <clc/math/gentype.inc>
 
 #undef __CLC_FUNCTION
-

diff  --git a/libclc/generic/include/clc/math/fmin.h b/libclc/opencl/include/clc/opencl/math/fmin.h
similarity index 99%
rename from libclc/generic/include/clc/math/fmin.h
rename to libclc/opencl/include/clc/opencl/math/fmin.h
index 45d83909cef5c..5a2af3725bf2b 100644
--- a/libclc/generic/include/clc/math/fmin.h
+++ b/libclc/opencl/include/clc/opencl/math/fmin.h
@@ -12,4 +12,3 @@
 #include <clc/math/gentype.inc>
 
 #undef __CLC_FUNCTION
-

diff  --git a/libclc/generic/include/clc/math/fmod.h b/libclc/opencl/include/clc/opencl/math/fmod.h
similarity index 100%
rename from libclc/generic/include/clc/math/fmod.h
rename to libclc/opencl/include/clc/opencl/math/fmod.h

diff  --git a/libclc/generic/include/clc/math/fract.h b/libclc/opencl/include/clc/opencl/math/fract.h
similarity index 100%
rename from libclc/generic/include/clc/math/fract.h
rename to libclc/opencl/include/clc/opencl/math/fract.h

diff  --git a/libclc/generic/include/clc/math/frexp.h b/libclc/opencl/include/clc/opencl/math/frexp.h
similarity index 89%
rename from libclc/generic/include/clc/math/frexp.h
rename to libclc/opencl/include/clc/opencl/math/frexp.h
index d62d92bd8fa96..a03aefbf60899 100644
--- a/libclc/generic/include/clc/math/frexp.h
+++ b/libclc/opencl/include/clc/opencl/math/frexp.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/math/frexp.inc>
+#define __CLC_BODY <clc/opencl/math/frexp.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/opencl/include/clc/opencl/math/frexp.inc b/libclc/opencl/include/clc/opencl/math/frexp.inc
new file mode 100644
index 0000000000000..620db60636107
--- /dev/null
+++ b/libclc/opencl/include/clc/opencl/math/frexp.inc
@@ -0,0 +1,14 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x,
+                                            global __CLC_INTN *iptr);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x,
+                                            local __CLC_INTN *iptr);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x,
+                                            private __CLC_INTN *iptr);

diff  --git a/libclc/generic/include/clc/math/half_cos.h b/libclc/opencl/include/clc/opencl/math/half_cos.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_cos.h
rename to libclc/opencl/include/clc/opencl/math/half_cos.h

diff  --git a/libclc/generic/include/clc/math/half_divide.h b/libclc/opencl/include/clc/opencl/math/half_divide.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_divide.h
rename to libclc/opencl/include/clc/opencl/math/half_divide.h

diff  --git a/libclc/generic/include/clc/math/half_exp.h b/libclc/opencl/include/clc/opencl/math/half_exp.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_exp.h
rename to libclc/opencl/include/clc/opencl/math/half_exp.h

diff  --git a/libclc/generic/include/clc/math/half_exp10.h b/libclc/opencl/include/clc/opencl/math/half_exp10.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_exp10.h
rename to libclc/opencl/include/clc/opencl/math/half_exp10.h

diff  --git a/libclc/generic/include/clc/math/half_exp2.h b/libclc/opencl/include/clc/opencl/math/half_exp2.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_exp2.h
rename to libclc/opencl/include/clc/opencl/math/half_exp2.h

diff  --git a/libclc/generic/include/clc/math/half_log.h b/libclc/opencl/include/clc/opencl/math/half_log.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_log.h
rename to libclc/opencl/include/clc/opencl/math/half_log.h

diff  --git a/libclc/generic/include/clc/math/half_log10.h b/libclc/opencl/include/clc/opencl/math/half_log10.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_log10.h
rename to libclc/opencl/include/clc/opencl/math/half_log10.h

diff  --git a/libclc/generic/include/clc/math/half_log2.h b/libclc/opencl/include/clc/opencl/math/half_log2.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_log2.h
rename to libclc/opencl/include/clc/opencl/math/half_log2.h

diff  --git a/libclc/generic/include/clc/math/half_powr.h b/libclc/opencl/include/clc/opencl/math/half_powr.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_powr.h
rename to libclc/opencl/include/clc/opencl/math/half_powr.h

diff  --git a/libclc/generic/include/clc/math/half_recip.h b/libclc/opencl/include/clc/opencl/math/half_recip.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_recip.h
rename to libclc/opencl/include/clc/opencl/math/half_recip.h

diff  --git a/libclc/generic/include/clc/math/half_rsqrt.h b/libclc/opencl/include/clc/opencl/math/half_rsqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_rsqrt.h
rename to libclc/opencl/include/clc/opencl/math/half_rsqrt.h

diff  --git a/libclc/generic/include/clc/math/half_sin.h b/libclc/opencl/include/clc/opencl/math/half_sin.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_sin.h
rename to libclc/opencl/include/clc/opencl/math/half_sin.h

diff  --git a/libclc/generic/include/clc/math/half_sqrt.h b/libclc/opencl/include/clc/opencl/math/half_sqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_sqrt.h
rename to libclc/opencl/include/clc/opencl/math/half_sqrt.h

diff  --git a/libclc/generic/include/clc/math/half_tan.h b/libclc/opencl/include/clc/opencl/math/half_tan.h
similarity index 100%
rename from libclc/generic/include/clc/math/half_tan.h
rename to libclc/opencl/include/clc/opencl/math/half_tan.h

diff  --git a/libclc/generic/include/clc/math/hypot.h b/libclc/opencl/include/clc/opencl/math/hypot.h
similarity index 100%
rename from libclc/generic/include/clc/math/hypot.h
rename to libclc/opencl/include/clc/opencl/math/hypot.h

diff  --git a/libclc/generic/include/clc/math/ilogb.h b/libclc/opencl/include/clc/opencl/math/ilogb.h
similarity index 100%
rename from libclc/generic/include/clc/math/ilogb.h
rename to libclc/opencl/include/clc/opencl/math/ilogb.h

diff  --git a/libclc/generic/include/clc/math/ldexp.h b/libclc/opencl/include/clc/opencl/math/ldexp.h
similarity index 89%
rename from libclc/generic/include/clc/math/ldexp.h
rename to libclc/opencl/include/clc/opencl/math/ldexp.h
index 804b4edd67c3b..6dcd2a9548d09 100644
--- a/libclc/generic/include/clc/math/ldexp.h
+++ b/libclc/opencl/include/clc/opencl/math/ldexp.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/math/ldexp.inc>
+#define __CLC_BODY <clc/opencl/math/ldexp.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/generic/include/clc/math/ldexp.inc b/libclc/opencl/include/clc/opencl/math/ldexp.inc
similarity index 100%
rename from libclc/generic/include/clc/math/ldexp.inc
rename to libclc/opencl/include/clc/opencl/math/ldexp.inc

diff  --git a/libclc/generic/include/clc/math/lgamma.h b/libclc/opencl/include/clc/opencl/math/lgamma.h
similarity index 100%
rename from libclc/generic/include/clc/math/lgamma.h
rename to libclc/opencl/include/clc/opencl/math/lgamma.h

diff  --git a/libclc/generic/include/clc/math/lgamma_r.h b/libclc/opencl/include/clc/opencl/math/lgamma_r.h
similarity index 100%
rename from libclc/generic/include/clc/math/lgamma_r.h
rename to libclc/opencl/include/clc/opencl/math/lgamma_r.h

diff  --git a/libclc/generic/include/clc/math/log.h b/libclc/opencl/include/clc/opencl/math/log.h
similarity index 100%
rename from libclc/generic/include/clc/math/log.h
rename to libclc/opencl/include/clc/opencl/math/log.h

diff  --git a/libclc/generic/include/clc/math/log10.h b/libclc/opencl/include/clc/opencl/math/log10.h
similarity index 100%
rename from libclc/generic/include/clc/math/log10.h
rename to libclc/opencl/include/clc/opencl/math/log10.h

diff  --git a/libclc/generic/include/clc/math/log1p.h b/libclc/opencl/include/clc/opencl/math/log1p.h
similarity index 100%
rename from libclc/generic/include/clc/math/log1p.h
rename to libclc/opencl/include/clc/opencl/math/log1p.h

diff  --git a/libclc/generic/include/clc/math/log2.h b/libclc/opencl/include/clc/opencl/math/log2.h
similarity index 100%
rename from libclc/generic/include/clc/math/log2.h
rename to libclc/opencl/include/clc/opencl/math/log2.h

diff  --git a/libclc/generic/include/clc/math/logb.h b/libclc/opencl/include/clc/opencl/math/logb.h
similarity index 100%
rename from libclc/generic/include/clc/math/logb.h
rename to libclc/opencl/include/clc/opencl/math/logb.h

diff  --git a/libclc/generic/include/clc/math/mad.h b/libclc/opencl/include/clc/opencl/math/mad.h
similarity index 100%
rename from libclc/generic/include/clc/math/mad.h
rename to libclc/opencl/include/clc/opencl/math/mad.h

diff  --git a/libclc/generic/include/clc/math/maxmag.h b/libclc/opencl/include/clc/opencl/math/maxmag.h
similarity index 100%
rename from libclc/generic/include/clc/math/maxmag.h
rename to libclc/opencl/include/clc/opencl/math/maxmag.h

diff  --git a/libclc/generic/include/clc/math/minmag.h b/libclc/opencl/include/clc/opencl/math/minmag.h
similarity index 100%
rename from libclc/generic/include/clc/math/minmag.h
rename to libclc/opencl/include/clc/opencl/math/minmag.h

diff  --git a/libclc/generic/include/clc/math/modf.h b/libclc/opencl/include/clc/opencl/math/modf.h
similarity index 100%
rename from libclc/generic/include/clc/math/modf.h
rename to libclc/opencl/include/clc/opencl/math/modf.h

diff  --git a/libclc/generic/include/clc/math/nan.h b/libclc/opencl/include/clc/opencl/math/nan.h
similarity index 89%
rename from libclc/generic/include/clc/math/nan.h
rename to libclc/opencl/include/clc/opencl/math/nan.h
index ccd209ffe4427..c5be0af945a57 100644
--- a/libclc/generic/include/clc/math/nan.h
+++ b/libclc/opencl/include/clc/opencl/math/nan.h
@@ -6,5 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/math/nan.inc>
+#define __CLC_BODY <clc/opencl/math/nan.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/generic/include/clc/math/nan.inc b/libclc/opencl/include/clc/opencl/math/nan.inc
similarity index 100%
rename from libclc/generic/include/clc/math/nan.inc
rename to libclc/opencl/include/clc/opencl/math/nan.inc

diff  --git a/libclc/generic/include/clc/math/native_cos.h b/libclc/opencl/include/clc/opencl/math/native_cos.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_cos.h
rename to libclc/opencl/include/clc/opencl/math/native_cos.h

diff  --git a/libclc/generic/include/clc/math/native_divide.h b/libclc/opencl/include/clc/opencl/math/native_divide.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_divide.h
rename to libclc/opencl/include/clc/opencl/math/native_divide.h

diff  --git a/libclc/generic/include/clc/math/native_exp.h b/libclc/opencl/include/clc/opencl/math/native_exp.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_exp.h
rename to libclc/opencl/include/clc/opencl/math/native_exp.h

diff  --git a/libclc/generic/include/clc/math/native_exp10.h b/libclc/opencl/include/clc/opencl/math/native_exp10.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_exp10.h
rename to libclc/opencl/include/clc/opencl/math/native_exp10.h

diff  --git a/libclc/generic/include/clc/math/native_exp2.h b/libclc/opencl/include/clc/opencl/math/native_exp2.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_exp2.h
rename to libclc/opencl/include/clc/opencl/math/native_exp2.h

diff  --git a/libclc/generic/include/clc/math/native_log.h b/libclc/opencl/include/clc/opencl/math/native_log.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_log.h
rename to libclc/opencl/include/clc/opencl/math/native_log.h

diff  --git a/libclc/generic/include/clc/math/native_log10.h b/libclc/opencl/include/clc/opencl/math/native_log10.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_log10.h
rename to libclc/opencl/include/clc/opencl/math/native_log10.h

diff  --git a/libclc/generic/include/clc/math/native_log2.h b/libclc/opencl/include/clc/opencl/math/native_log2.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_log2.h
rename to libclc/opencl/include/clc/opencl/math/native_log2.h

diff  --git a/libclc/generic/include/clc/math/native_powr.h b/libclc/opencl/include/clc/opencl/math/native_powr.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_powr.h
rename to libclc/opencl/include/clc/opencl/math/native_powr.h

diff  --git a/libclc/generic/include/clc/math/native_recip.h b/libclc/opencl/include/clc/opencl/math/native_recip.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_recip.h
rename to libclc/opencl/include/clc/opencl/math/native_recip.h

diff  --git a/libclc/generic/include/clc/math/native_rsqrt.h b/libclc/opencl/include/clc/opencl/math/native_rsqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_rsqrt.h
rename to libclc/opencl/include/clc/opencl/math/native_rsqrt.h

diff  --git a/libclc/generic/include/clc/math/native_sin.h b/libclc/opencl/include/clc/opencl/math/native_sin.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_sin.h
rename to libclc/opencl/include/clc/opencl/math/native_sin.h

diff  --git a/libclc/generic/include/clc/math/native_sqrt.h b/libclc/opencl/include/clc/opencl/math/native_sqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_sqrt.h
rename to libclc/opencl/include/clc/opencl/math/native_sqrt.h

diff  --git a/libclc/generic/include/clc/math/native_tan.h b/libclc/opencl/include/clc/opencl/math/native_tan.h
similarity index 100%
rename from libclc/generic/include/clc/math/native_tan.h
rename to libclc/opencl/include/clc/opencl/math/native_tan.h

diff  --git a/libclc/generic/include/clc/math/nextafter.h b/libclc/opencl/include/clc/opencl/math/nextafter.h
similarity index 100%
rename from libclc/generic/include/clc/math/nextafter.h
rename to libclc/opencl/include/clc/opencl/math/nextafter.h

diff  --git a/libclc/generic/include/clc/math/pow.h b/libclc/opencl/include/clc/opencl/math/pow.h
similarity index 100%
rename from libclc/generic/include/clc/math/pow.h
rename to libclc/opencl/include/clc/opencl/math/pow.h

diff  --git a/libclc/generic/include/clc/math/pown.h b/libclc/opencl/include/clc/opencl/math/pown.h
similarity index 100%
rename from libclc/generic/include/clc/math/pown.h
rename to libclc/opencl/include/clc/opencl/math/pown.h

diff  --git a/libclc/generic/include/clc/math/powr.h b/libclc/opencl/include/clc/opencl/math/powr.h
similarity index 100%
rename from libclc/generic/include/clc/math/powr.h
rename to libclc/opencl/include/clc/opencl/math/powr.h

diff  --git a/libclc/generic/include/clc/math/remainder.h b/libclc/opencl/include/clc/opencl/math/remainder.h
similarity index 100%
rename from libclc/generic/include/clc/math/remainder.h
rename to libclc/opencl/include/clc/opencl/math/remainder.h

diff  --git a/libclc/generic/include/clc/math/remquo.h b/libclc/opencl/include/clc/opencl/math/remquo.h
similarity index 100%
rename from libclc/generic/include/clc/math/remquo.h
rename to libclc/opencl/include/clc/opencl/math/remquo.h

diff  --git a/libclc/generic/include/clc/math/rint.h b/libclc/opencl/include/clc/opencl/math/rint.h
similarity index 100%
rename from libclc/generic/include/clc/math/rint.h
rename to libclc/opencl/include/clc/opencl/math/rint.h

diff  --git a/libclc/generic/include/clc/math/rootn.h b/libclc/opencl/include/clc/opencl/math/rootn.h
similarity index 100%
rename from libclc/generic/include/clc/math/rootn.h
rename to libclc/opencl/include/clc/opencl/math/rootn.h

diff  --git a/libclc/generic/include/clc/math/round.h b/libclc/opencl/include/clc/opencl/math/round.h
similarity index 100%
rename from libclc/generic/include/clc/math/round.h
rename to libclc/opencl/include/clc/opencl/math/round.h

diff  --git a/libclc/generic/include/clc/math/rsqrt.h b/libclc/opencl/include/clc/opencl/math/rsqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/rsqrt.h
rename to libclc/opencl/include/clc/opencl/math/rsqrt.h

diff  --git a/libclc/generic/include/clc/math/sin.h b/libclc/opencl/include/clc/opencl/math/sin.h
similarity index 100%
rename from libclc/generic/include/clc/math/sin.h
rename to libclc/opencl/include/clc/opencl/math/sin.h

diff  --git a/libclc/generic/include/clc/math/sincos.h b/libclc/opencl/include/clc/opencl/math/sincos.h
similarity index 100%
rename from libclc/generic/include/clc/math/sincos.h
rename to libclc/opencl/include/clc/opencl/math/sincos.h

diff  --git a/libclc/generic/include/clc/math/sinh.h b/libclc/opencl/include/clc/opencl/math/sinh.h
similarity index 100%
rename from libclc/generic/include/clc/math/sinh.h
rename to libclc/opencl/include/clc/opencl/math/sinh.h

diff  --git a/libclc/generic/include/clc/math/sinpi.h b/libclc/opencl/include/clc/opencl/math/sinpi.h
similarity index 100%
rename from libclc/generic/include/clc/math/sinpi.h
rename to libclc/opencl/include/clc/opencl/math/sinpi.h

diff  --git a/libclc/generic/include/clc/math/sqrt.h b/libclc/opencl/include/clc/opencl/math/sqrt.h
similarity index 100%
rename from libclc/generic/include/clc/math/sqrt.h
rename to libclc/opencl/include/clc/opencl/math/sqrt.h

diff  --git a/libclc/generic/include/clc/math/tan.h b/libclc/opencl/include/clc/opencl/math/tan.h
similarity index 100%
rename from libclc/generic/include/clc/math/tan.h
rename to libclc/opencl/include/clc/opencl/math/tan.h

diff  --git a/libclc/generic/include/clc/math/tanh.h b/libclc/opencl/include/clc/opencl/math/tanh.h
similarity index 100%
rename from libclc/generic/include/clc/math/tanh.h
rename to libclc/opencl/include/clc/opencl/math/tanh.h

diff  --git a/libclc/generic/include/clc/math/tanpi.h b/libclc/opencl/include/clc/opencl/math/tanpi.h
similarity index 100%
rename from libclc/generic/include/clc/math/tanpi.h
rename to libclc/opencl/include/clc/opencl/math/tanpi.h

diff  --git a/libclc/generic/include/clc/math/tgamma.h b/libclc/opencl/include/clc/opencl/math/tgamma.h
similarity index 100%
rename from libclc/generic/include/clc/math/tgamma.h
rename to libclc/opencl/include/clc/opencl/math/tgamma.h

diff  --git a/libclc/generic/include/clc/math/trunc.h b/libclc/opencl/include/clc/opencl/math/trunc.h
similarity index 100%
rename from libclc/generic/include/clc/math/trunc.h
rename to libclc/opencl/include/clc/opencl/math/trunc.h

diff  --git a/libclc/generic/include/clc/misc/shuffle.h b/libclc/opencl/include/clc/opencl/misc/shuffle.h
similarity index 100%
rename from libclc/generic/include/clc/misc/shuffle.h
rename to libclc/opencl/include/clc/opencl/misc/shuffle.h

diff  --git a/libclc/generic/include/clc/misc/shuffle2.h b/libclc/opencl/include/clc/opencl/misc/shuffle2.h
similarity index 52%
rename from libclc/generic/include/clc/misc/shuffle2.h
rename to libclc/opencl/include/clc/opencl/misc/shuffle2.h
index 93845f89911bd..fa33f6058d583 100644
--- a/libclc/generic/include/clc/misc/shuffle2.h
+++ b/libclc/opencl/include/clc/opencl/misc/shuffle2.h
@@ -6,24 +6,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_SHUFFLE2_DECL(TYPE, MASKTYPE, RETTYPE) \
+#define _CLC_SHUFFLE2_DECL(TYPE, MASKTYPE, RETTYPE)                            \
   _CLC_OVERLOAD _CLC_DECL RETTYPE shuffle2(TYPE x, TYPE y, MASKTYPE mask);
 
-//Return type is same base type as the input type, with the same vector size as the mask.
-//Elements in the mask must be the same size (number of bits) as the input value.
-//E.g. char8 ret = shuffle2(char2 x, char2 y, uchar8 mask);
+// Return type is same base type as the input type, with the same vector size as
+// the mask. Elements in the mask must be the same size (number of bits) as the
+// input value. E.g. char8 ret = shuffle2(char2 x, char2 y, uchar8 mask);
 
-#define _CLC_VECTOR_SHUFFLE2_MASKSIZE(INBASE, INTYPE, MASKTYPE) \
-  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##2, INBASE##2) \
-  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##4, INBASE##4) \
-  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##8, INBASE##8) \
-  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##16, INBASE##16) \
+#define _CLC_VECTOR_SHUFFLE2_MASKSIZE(INBASE, INTYPE, MASKTYPE)                \
+  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##2, INBASE##2)                           \
+  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##4, INBASE##4)                           \
+  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##8, INBASE##8)                           \
+  _CLC_SHUFFLE2_DECL(INTYPE, MASKTYPE##16, INBASE##16)
 
-#define _CLC_VECTOR_SHUFFLE2_INSIZE(TYPE, MASKTYPE) \
-  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##2, MASKTYPE) \
-  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##4, MASKTYPE) \
-  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##8, MASKTYPE) \
-  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##16, MASKTYPE) \
+#define _CLC_VECTOR_SHUFFLE2_INSIZE(TYPE, MASKTYPE)                            \
+  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##2, MASKTYPE)                       \
+  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##4, MASKTYPE)                       \
+  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##8, MASKTYPE)                       \
+  _CLC_VECTOR_SHUFFLE2_MASKSIZE(TYPE, TYPE##16, MASKTYPE)
 
 _CLC_VECTOR_SHUFFLE2_INSIZE(char, uchar)
 _CLC_VECTOR_SHUFFLE2_INSIZE(short, ushort)

diff  --git a/libclc/generic/include/clc/relational/all.h b/libclc/opencl/include/clc/opencl/relational/all.h
similarity index 50%
rename from libclc/generic/include/clc/relational/all.h
rename to libclc/opencl/include/clc/opencl/relational/all.h
index a52afe813f5a1..31c8e895f6661 100644
--- a/libclc/generic/include/clc/relational/all.h
+++ b/libclc/opencl/include/clc/opencl/relational/all.h
@@ -6,15 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_ALL_DECL(TYPE) \
-  _CLC_OVERLOAD _CLC_DECL int all(TYPE v);
+#define _CLC_ALL_DECL(TYPE) _CLC_OVERLOAD _CLC_DECL int all(TYPE v);
 
-#define _CLC_VECTOR_ALL_DECL(TYPE) \
-  _CLC_ALL_DECL(TYPE)     \
-  _CLC_ALL_DECL(TYPE##2)  \
-  _CLC_ALL_DECL(TYPE##3)  \
-  _CLC_ALL_DECL(TYPE##4)  \
-  _CLC_ALL_DECL(TYPE##8)  \
+#define _CLC_VECTOR_ALL_DECL(TYPE)                                             \
+  _CLC_ALL_DECL(TYPE)                                                          \
+  _CLC_ALL_DECL(TYPE##2)                                                       \
+  _CLC_ALL_DECL(TYPE##3)                                                       \
+  _CLC_ALL_DECL(TYPE##4)                                                       \
+  _CLC_ALL_DECL(TYPE##8)                                                       \
   _CLC_ALL_DECL(TYPE##16)
 
 _CLC_VECTOR_ALL_DECL(char)

diff  --git a/libclc/generic/include/clc/relational/any.h b/libclc/opencl/include/clc/opencl/relational/any.h
similarity index 50%
rename from libclc/generic/include/clc/relational/any.h
rename to libclc/opencl/include/clc/opencl/relational/any.h
index 4839135de06fb..9c227e8f1600e 100644
--- a/libclc/generic/include/clc/relational/any.h
+++ b/libclc/opencl/include/clc/opencl/relational/any.h
@@ -6,15 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_ANY_DECL(TYPE) \
-  _CLC_OVERLOAD _CLC_DECL int any(TYPE v);
+#define _CLC_ANY_DECL(TYPE) _CLC_OVERLOAD _CLC_DECL int any(TYPE v);
 
-#define _CLC_VECTOR_ANY_DECL(TYPE) \
-  _CLC_ANY_DECL(TYPE)     \
-  _CLC_ANY_DECL(TYPE##2)  \
-  _CLC_ANY_DECL(TYPE##3)  \
-  _CLC_ANY_DECL(TYPE##4)  \
-  _CLC_ANY_DECL(TYPE##8)  \
+#define _CLC_VECTOR_ANY_DECL(TYPE)                                             \
+  _CLC_ANY_DECL(TYPE)                                                          \
+  _CLC_ANY_DECL(TYPE##2)                                                       \
+  _CLC_ANY_DECL(TYPE##3)                                                       \
+  _CLC_ANY_DECL(TYPE##4)                                                       \
+  _CLC_ANY_DECL(TYPE##8)                                                       \
   _CLC_ANY_DECL(TYPE##16)
 
 _CLC_VECTOR_ANY_DECL(char)

diff  --git a/libclc/generic/include/clc/relational/bitselect.h b/libclc/opencl/include/clc/opencl/relational/bitselect.h
similarity index 79%
rename from libclc/generic/include/clc/relational/bitselect.h
rename to libclc/opencl/include/clc/opencl/relational/bitselect.h
index 25cb0c2fd9241..7a39d5468e5ff 100644
--- a/libclc/generic/include/clc/relational/bitselect.h
+++ b/libclc/opencl/include/clc/opencl/relational/bitselect.h
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/relational/bitselect.inc>
+#define __CLC_BODY <clc/opencl/relational/bitselect.inc>
 #include <clc/math/gentype.inc>
-#define __CLC_BODY <clc/relational/bitselect.inc>
+#define __CLC_BODY <clc/opencl/relational/bitselect.inc>
 #include <clc/integer/gentype.inc>

diff  --git a/libclc/generic/include/clc/relational/bitselect.inc b/libclc/opencl/include/clc/opencl/relational/bitselect.inc
similarity index 76%
rename from libclc/generic/include/clc/relational/bitselect.inc
rename to libclc/opencl/include/clc/opencl/relational/bitselect.inc
index d7708da2a9a44..d821bb86a1409 100644
--- a/libclc/generic/include/clc/relational/bitselect.inc
+++ b/libclc/opencl/include/clc/opencl/relational/bitselect.inc
@@ -6,4 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE bitselect(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE bitselect(__CLC_GENTYPE x,
+                                                __CLC_GENTYPE y,
+                                                __CLC_GENTYPE z);

diff  --git a/libclc/generic/include/clc/relational/isequal.h b/libclc/opencl/include/clc/opencl/relational/isequal.h
similarity index 61%
rename from libclc/generic/include/clc/relational/isequal.h
rename to libclc/opencl/include/clc/opencl/relational/isequal.h
index 29e5cf9829fab..090b9928ede25 100644
--- a/libclc/generic/include/clc/relational/isequal.h
+++ b/libclc/opencl/include/clc/opencl/relational/isequal.h
@@ -6,14 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_ISEQUAL_DECL(TYPE, RETTYPE) \
+#define _CLC_ISEQUAL_DECL(TYPE, RETTYPE)                                       \
   _CLC_OVERLOAD _CLC_DECL RETTYPE isequal(TYPE x, TYPE y);
 
-#define _CLC_VECTOR_ISEQUAL_DECL(TYPE, RETTYPE) \
-  _CLC_ISEQUAL_DECL(TYPE##2, RETTYPE##2)  \
-  _CLC_ISEQUAL_DECL(TYPE##3, RETTYPE##3)  \
-  _CLC_ISEQUAL_DECL(TYPE##4, RETTYPE##4)  \
-  _CLC_ISEQUAL_DECL(TYPE##8, RETTYPE##8)  \
+#define _CLC_VECTOR_ISEQUAL_DECL(TYPE, RETTYPE)                                \
+  _CLC_ISEQUAL_DECL(TYPE##2, RETTYPE##2)                                       \
+  _CLC_ISEQUAL_DECL(TYPE##3, RETTYPE##3)                                       \
+  _CLC_ISEQUAL_DECL(TYPE##4, RETTYPE##4)                                       \
+  _CLC_ISEQUAL_DECL(TYPE##8, RETTYPE##8)                                       \
   _CLC_ISEQUAL_DECL(TYPE##16, RETTYPE##16)
 
 _CLC_ISEQUAL_DECL(float, int)

diff  --git a/libclc/generic/include/clc/relational/isfinite.h b/libclc/opencl/include/clc/opencl/relational/isfinite.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isfinite.h
rename to libclc/opencl/include/clc/opencl/relational/isfinite.h

diff  --git a/libclc/generic/include/clc/relational/isgreater.h b/libclc/opencl/include/clc/opencl/relational/isgreater.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isgreater.h
rename to libclc/opencl/include/clc/opencl/relational/isgreater.h

diff  --git a/libclc/generic/include/clc/relational/isgreaterequal.h b/libclc/opencl/include/clc/opencl/relational/isgreaterequal.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isgreaterequal.h
rename to libclc/opencl/include/clc/opencl/relational/isgreaterequal.h

diff  --git a/libclc/generic/include/clc/relational/isinf.h b/libclc/opencl/include/clc/opencl/relational/isinf.h
similarity index 61%
rename from libclc/generic/include/clc/relational/isinf.h
rename to libclc/opencl/include/clc/opencl/relational/isinf.h
index 4a026b4b0365c..da38b01e364b5 100644
--- a/libclc/generic/include/clc/relational/isinf.h
+++ b/libclc/opencl/include/clc/opencl/relational/isinf.h
@@ -6,14 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_ISINF_DECL(RET_TYPE, ARG_TYPE) \
+#define _CLC_ISINF_DECL(RET_TYPE, ARG_TYPE)                                    \
   _CLC_OVERLOAD _CLC_DECL RET_TYPE isinf(ARG_TYPE);
 
-#define _CLC_VECTOR_ISINF_DECL(RET_TYPE, ARG_TYPE) \
-  _CLC_ISINF_DECL(RET_TYPE##2, ARG_TYPE##2) \
-  _CLC_ISINF_DECL(RET_TYPE##3, ARG_TYPE##3) \
-  _CLC_ISINF_DECL(RET_TYPE##4, ARG_TYPE##4) \
-  _CLC_ISINF_DECL(RET_TYPE##8, ARG_TYPE##8) \
+#define _CLC_VECTOR_ISINF_DECL(RET_TYPE, ARG_TYPE)                             \
+  _CLC_ISINF_DECL(RET_TYPE##2, ARG_TYPE##2)                                    \
+  _CLC_ISINF_DECL(RET_TYPE##3, ARG_TYPE##3)                                    \
+  _CLC_ISINF_DECL(RET_TYPE##4, ARG_TYPE##4)                                    \
+  _CLC_ISINF_DECL(RET_TYPE##8, ARG_TYPE##8)                                    \
   _CLC_ISINF_DECL(RET_TYPE##16, ARG_TYPE##16)
 
 _CLC_ISINF_DECL(int, float)

diff  --git a/libclc/generic/include/clc/relational/isless.h b/libclc/opencl/include/clc/opencl/relational/isless.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isless.h
rename to libclc/opencl/include/clc/opencl/relational/isless.h

diff  --git a/libclc/generic/include/clc/relational/islessequal.h b/libclc/opencl/include/clc/opencl/relational/islessequal.h
similarity index 100%
rename from libclc/generic/include/clc/relational/islessequal.h
rename to libclc/opencl/include/clc/opencl/relational/islessequal.h

diff  --git a/libclc/generic/include/clc/relational/islessgreater.h b/libclc/opencl/include/clc/opencl/relational/islessgreater.h
similarity index 100%
rename from libclc/generic/include/clc/relational/islessgreater.h
rename to libclc/opencl/include/clc/opencl/relational/islessgreater.h

diff  --git a/libclc/generic/include/clc/relational/isnan.h b/libclc/opencl/include/clc/opencl/relational/isnan.h
similarity index 61%
rename from libclc/generic/include/clc/relational/isnan.h
rename to libclc/opencl/include/clc/opencl/relational/isnan.h
index e8033d60f3c1a..e712d6a5d93a9 100644
--- a/libclc/generic/include/clc/relational/isnan.h
+++ b/libclc/opencl/include/clc/opencl/relational/isnan.h
@@ -6,14 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define _CLC_ISNAN_DECL(RET_TYPE, ARG_TYPE) \
+#define _CLC_ISNAN_DECL(RET_TYPE, ARG_TYPE)                                    \
   _CLC_OVERLOAD _CLC_DECL RET_TYPE isnan(ARG_TYPE);
 
-#define _CLC_VECTOR_ISNAN_DECL(RET_TYPE, ARG_TYPE) \
-  _CLC_ISNAN_DECL(RET_TYPE##2, ARG_TYPE##2) \
-  _CLC_ISNAN_DECL(RET_TYPE##3, ARG_TYPE##3) \
-  _CLC_ISNAN_DECL(RET_TYPE##4, ARG_TYPE##4) \
-  _CLC_ISNAN_DECL(RET_TYPE##8, ARG_TYPE##8) \
+#define _CLC_VECTOR_ISNAN_DECL(RET_TYPE, ARG_TYPE)                             \
+  _CLC_ISNAN_DECL(RET_TYPE##2, ARG_TYPE##2)                                    \
+  _CLC_ISNAN_DECL(RET_TYPE##3, ARG_TYPE##3)                                    \
+  _CLC_ISNAN_DECL(RET_TYPE##4, ARG_TYPE##4)                                    \
+  _CLC_ISNAN_DECL(RET_TYPE##8, ARG_TYPE##8)                                    \
   _CLC_ISNAN_DECL(RET_TYPE##16, ARG_TYPE##16)
 
 _CLC_ISNAN_DECL(int, float)

diff  --git a/libclc/generic/include/clc/relational/isnormal.h b/libclc/opencl/include/clc/opencl/relational/isnormal.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isnormal.h
rename to libclc/opencl/include/clc/opencl/relational/isnormal.h

diff  --git a/libclc/generic/include/clc/relational/isnotequal.h b/libclc/opencl/include/clc/opencl/relational/isnotequal.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isnotequal.h
rename to libclc/opencl/include/clc/opencl/relational/isnotequal.h

diff  --git a/libclc/generic/include/clc/relational/isordered.h b/libclc/opencl/include/clc/opencl/relational/isordered.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isordered.h
rename to libclc/opencl/include/clc/opencl/relational/isordered.h

diff  --git a/libclc/generic/include/clc/relational/isunordered.h b/libclc/opencl/include/clc/opencl/relational/isunordered.h
similarity index 100%
rename from libclc/generic/include/clc/relational/isunordered.h
rename to libclc/opencl/include/clc/opencl/relational/isunordered.h

diff  --git a/libclc/generic/include/clc/relational/select.h b/libclc/opencl/include/clc/opencl/relational/select.h
similarity index 100%
rename from libclc/generic/include/clc/relational/select.h
rename to libclc/opencl/include/clc/opencl/relational/select.h

diff  --git a/libclc/generic/include/clc/relational/signbit.h b/libclc/opencl/include/clc/opencl/relational/signbit.h
similarity index 100%
rename from libclc/generic/include/clc/relational/signbit.h
rename to libclc/opencl/include/clc/opencl/relational/signbit.h

diff  --git a/libclc/generic/include/clc/shared/clamp.h b/libclc/opencl/include/clc/opencl/shared/clamp.h
similarity index 81%
rename from libclc/generic/include/clc/shared/clamp.h
rename to libclc/opencl/include/clc/opencl/shared/clamp.h
index 06d2282cebc66..4fe7897f56016 100644
--- a/libclc/generic/include/clc/shared/clamp.h
+++ b/libclc/opencl/include/clc/opencl/shared/clamp.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/shared/clamp.inc>
+#define __CLC_BODY <clc/opencl/shared/clamp.inc>
 #include <clc/integer/gentype.inc>
 
-#define __CLC_BODY <clc/shared/clamp.inc>
+#define __CLC_BODY <clc/opencl/shared/clamp.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/generic/include/clc/shared/clamp.inc b/libclc/opencl/include/clc/opencl/shared/clamp.inc
similarity index 62%
rename from libclc/generic/include/clc/shared/clamp.inc
rename to libclc/opencl/include/clc/opencl/shared/clamp.inc
index fdf7ac742b42b..75dec9c258e8a 100644
--- a/libclc/generic/include/clc/shared/clamp.inc
+++ b/libclc/opencl/include/clc/opencl/shared/clamp.inc
@@ -6,8 +6,11 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y,
+                                            __CLC_GENTYPE z);
 
 #ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_SCALAR_GENTYPE y, __CLC_SCALAR_GENTYPE z);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clamp(__CLC_GENTYPE x,
+                                            __CLC_SCALAR_GENTYPE y,
+                                            __CLC_SCALAR_GENTYPE z);
 #endif

diff  --git a/libclc/generic/include/clc/shared/max.h b/libclc/opencl/include/clc/opencl/shared/max.h
similarity index 82%
rename from libclc/generic/include/clc/shared/max.h
rename to libclc/opencl/include/clc/opencl/shared/max.h
index 0b56e56f4aee1..5ff01ba8082a2 100644
--- a/libclc/generic/include/clc/shared/max.h
+++ b/libclc/opencl/include/clc/opencl/shared/max.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/shared/max.inc>
+#define __CLC_BODY <clc/opencl/shared/max.inc>
 #include <clc/integer/gentype.inc>
 
-#define __CLC_BODY <clc/shared/max.inc>
+#define __CLC_BODY <clc/opencl/shared/max.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/generic/include/clc/shared/max.inc b/libclc/opencl/include/clc/opencl/shared/max.inc
similarity index 79%
rename from libclc/generic/include/clc/shared/max.inc
rename to libclc/opencl/include/clc/opencl/shared/max.inc
index 19f3e2d174e3d..98610dfdb1018 100644
--- a/libclc/generic/include/clc/shared/max.inc
+++ b/libclc/opencl/include/clc/opencl/shared/max.inc
@@ -9,5 +9,6 @@
 _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE max(__CLC_GENTYPE a, __CLC_GENTYPE b);
 
 #ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE max(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE max(__CLC_GENTYPE a,
+                                          __CLC_SCALAR_GENTYPE b);
 #endif

diff  --git a/libclc/generic/include/clc/shared/min.h b/libclc/opencl/include/clc/opencl/shared/min.h
similarity index 82%
rename from libclc/generic/include/clc/shared/min.h
rename to libclc/opencl/include/clc/opencl/shared/min.h
index 090fae2651883..573f837685be1 100644
--- a/libclc/generic/include/clc/shared/min.h
+++ b/libclc/opencl/include/clc/opencl/shared/min.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __CLC_BODY <clc/shared/min.inc>
+#define __CLC_BODY <clc/opencl/shared/min.inc>
 #include <clc/integer/gentype.inc>
 
-#define __CLC_BODY <clc/shared/min.inc>
+#define __CLC_BODY <clc/opencl/shared/min.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/generic/include/clc/shared/min.inc b/libclc/opencl/include/clc/opencl/shared/min.inc
similarity index 79%
rename from libclc/generic/include/clc/shared/min.inc
rename to libclc/opencl/include/clc/opencl/shared/min.inc
index e4e46c436b368..3140b637f3953 100644
--- a/libclc/generic/include/clc/shared/min.inc
+++ b/libclc/opencl/include/clc/opencl/shared/min.inc
@@ -9,5 +9,6 @@
 _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_GENTYPE b);
 
 #ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b);
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE min(__CLC_GENTYPE a,
+                                          __CLC_SCALAR_GENTYPE b);
 #endif

diff  --git a/libclc/generic/include/clc/shared/vload.h b/libclc/opencl/include/clc/opencl/shared/vload.h
similarity index 100%
rename from libclc/generic/include/clc/shared/vload.h
rename to libclc/opencl/include/clc/opencl/shared/vload.h

diff  --git a/libclc/generic/include/clc/shared/vstore.h b/libclc/opencl/include/clc/opencl/shared/vstore.h
similarity index 100%
rename from libclc/generic/include/clc/shared/vstore.h
rename to libclc/opencl/include/clc/opencl/shared/vstore.h

diff  --git a/libclc/generic/include/clc/synchronization/barrier.h b/libclc/opencl/include/clc/opencl/synchronization/barrier.h
similarity index 100%
rename from libclc/generic/include/clc/synchronization/barrier.h
rename to libclc/opencl/include/clc/opencl/synchronization/barrier.h

diff  --git a/libclc/generic/include/clc/synchronization/cl_mem_fence_flags.h b/libclc/opencl/include/clc/opencl/synchronization/cl_mem_fence_flags.h
similarity index 100%
rename from libclc/generic/include/clc/synchronization/cl_mem_fence_flags.h
rename to libclc/opencl/include/clc/opencl/synchronization/cl_mem_fence_flags.h

diff  --git a/libclc/generic/include/clc/workitem/get_global_id.h b/libclc/opencl/include/clc/opencl/workitem/get_global_id.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_global_id.h
rename to libclc/opencl/include/clc/opencl/workitem/get_global_id.h

diff  --git a/libclc/generic/include/clc/workitem/get_global_offset.h b/libclc/opencl/include/clc/opencl/workitem/get_global_offset.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_global_offset.h
rename to libclc/opencl/include/clc/opencl/workitem/get_global_offset.h

diff  --git a/libclc/generic/include/clc/workitem/get_global_size.h b/libclc/opencl/include/clc/opencl/workitem/get_global_size.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_global_size.h
rename to libclc/opencl/include/clc/opencl/workitem/get_global_size.h

diff  --git a/libclc/generic/include/clc/workitem/get_group_id.h b/libclc/opencl/include/clc/opencl/workitem/get_group_id.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_group_id.h
rename to libclc/opencl/include/clc/opencl/workitem/get_group_id.h

diff  --git a/libclc/generic/include/clc/workitem/get_local_id.h b/libclc/opencl/include/clc/opencl/workitem/get_local_id.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_local_id.h
rename to libclc/opencl/include/clc/opencl/workitem/get_local_id.h

diff  --git a/libclc/generic/include/clc/workitem/get_local_size.h b/libclc/opencl/include/clc/opencl/workitem/get_local_size.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_local_size.h
rename to libclc/opencl/include/clc/opencl/workitem/get_local_size.h

diff  --git a/libclc/generic/include/clc/workitem/get_num_groups.h b/libclc/opencl/include/clc/opencl/workitem/get_num_groups.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_num_groups.h
rename to libclc/opencl/include/clc/opencl/workitem/get_num_groups.h

diff  --git a/libclc/generic/include/clc/workitem/get_work_dim.h b/libclc/opencl/include/clc/opencl/workitem/get_work_dim.h
similarity index 100%
rename from libclc/generic/include/clc/workitem/get_work_dim.h
rename to libclc/opencl/include/clc/opencl/workitem/get_work_dim.h

diff  --git a/libclc/amdgcn-amdhsa/lib/SOURCES b/libclc/opencl/lib/amdgcn-amdhsa/SOURCES
similarity index 100%
rename from libclc/amdgcn-amdhsa/lib/SOURCES
rename to libclc/opencl/lib/amdgcn-amdhsa/SOURCES

diff  --git a/libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl
similarity index 88%
rename from libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl
rename to libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl
index 6d48a40117115..2d7fea91233aa 100644
--- a/libclc/amdgcn-amdhsa/lib/workitem/get_global_size.cl
+++ b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_global_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #if __clang_major__ >= 8
 #define CONST_AS __constant
@@ -20,7 +20,8 @@
 #define __dispatch_ptr __builtin_amdgcn_dispatch_ptr
 #else
 #define __dispatch_ptr __clc_amdgcn_dispatch_ptr
-CONST_AS uchar * __clc_amdgcn_dispatch_ptr(void) __asm("llvm.amdgcn.dispatch.ptr");
+CONST_AS uchar *
+__clc_amdgcn_dispatch_ptr(void) __asm("llvm.amdgcn.dispatch.ptr");
 #endif
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_size(uint dim) {

diff  --git a/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl
similarity index 89%
rename from libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl
rename to libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl
index 5ef8e1fd4435c..84552e2e08fd7 100644
--- a/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.cl
+++ b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_local_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #if __clang_major__ >= 8
 #define CONST_AS __constant
@@ -20,7 +20,8 @@
 #define __dispatch_ptr __builtin_amdgcn_dispatch_ptr
 #else
 #define __dispatch_ptr __clc_amdgcn_dispatch_ptr
-CONST_AS char * __clc_amdgcn_dispatch_ptr(void) __asm("llvm.amdgcn.dispatch.ptr");
+CONST_AS char *
+__clc_amdgcn_dispatch_ptr(void) __asm("llvm.amdgcn.dispatch.ptr");
 #endif
 
 _CLC_DEF _CLC_OVERLOAD size_t get_local_size(uint dim) {

diff  --git a/libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl
similarity index 95%
rename from libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
rename to libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl
index 2ef5197cd1fd3..1ed16736376f6 100644
--- a/libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
+++ b/libclc/opencl/lib/amdgcn-amdhsa/workitem/get_num_groups.cl
@@ -6,8 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_num_groups(uint dim) {
   size_t global_size = get_global_size(dim);

diff  --git a/libclc/amdgcn/lib/SOURCES b/libclc/opencl/lib/amdgcn/SOURCES
similarity index 100%
rename from libclc/amdgcn/lib/SOURCES
rename to libclc/opencl/lib/amdgcn/SOURCES

diff  --git a/libclc/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll b/libclc/opencl/lib/amdgcn/cl_khr_int64_extended_atomics/minmax_helpers.ll
similarity index 100%
rename from libclc/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll
rename to libclc/opencl/lib/amdgcn/cl_khr_int64_extended_atomics/minmax_helpers.ll

diff  --git a/libclc/amdgcn/lib/mem_fence/fence.cl b/libclc/opencl/lib/amdgcn/mem_fence/fence.cl
similarity index 86%
rename from libclc/amdgcn/lib/mem_fence/fence.cl
rename to libclc/opencl/lib/amdgcn/mem_fence/fence.cl
index 8d3492ed9122f..5c5029a63cfc7 100644
--- a/libclc/amdgcn/lib/mem_fence/fence.cl
+++ b/libclc/opencl/lib/amdgcn/mem_fence/fence.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 void __clc_amdgcn_s_waitcnt(unsigned flags);
 
@@ -19,10 +19,10 @@ void __clc_amdgcn_s_waitcnt(unsigned flags);
 
 // Newer clang supports __builtin_amdgcn_s_waitcnt
 #if __clang_major__ >= 5
-#  define __waitcnt(x) __builtin_amdgcn_s_waitcnt(x)
+#define __waitcnt(x) __builtin_amdgcn_s_waitcnt(x)
 #else
-#  define __waitcnt(x) __clc_amdgcn_s_waitcnt(x)
-_CLC_DEF void __clc_amdgcn_s_waitcnt(unsigned)  __asm("llvm.amdgcn.s.waitcnt");
+#define __waitcnt(x) __clc_amdgcn_s_waitcnt(x)
+_CLC_DEF void __clc_amdgcn_s_waitcnt(unsigned) __asm("llvm.amdgcn.s.waitcnt");
 #endif
 
 _CLC_DEF _CLC_OVERLOAD void mem_fence(cl_mem_fence_flags flags) {

diff  --git a/libclc/amdgcn/lib/synchronization/barrier.cl b/libclc/opencl/lib/amdgcn/synchronization/barrier.cl
similarity index 94%
rename from libclc/amdgcn/lib/synchronization/barrier.cl
rename to libclc/opencl/lib/amdgcn/synchronization/barrier.cl
index 248b9c1462b0c..f7c41aafa83c9 100644
--- a/libclc/amdgcn/lib/synchronization/barrier.cl
+++ b/libclc/opencl/lib/amdgcn/synchronization/barrier.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD void barrier(cl_mem_fence_flags flags) {
   mem_fence(flags);

diff  --git a/libclc/amdgcn/lib/workitem/get_global_offset.cl b/libclc/opencl/lib/amdgcn/workitem/get_global_offset.cl
similarity index 96%
rename from libclc/amdgcn/lib/workitem/get_global_offset.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_global_offset.cl
index 240dd806734df..a1b3ce4192793 100644
--- a/libclc/amdgcn/lib/workitem/get_global_offset.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_global_offset.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #if __clang_major__ >= 8
 #define CONST_AS __constant

diff  --git a/libclc/amdgcn/lib/workitem/get_global_size.cl b/libclc/opencl/lib/amdgcn/workitem/get_global_size.cl
similarity index 95%
rename from libclc/amdgcn/lib/workitem/get_global_size.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_global_size.cl
index 9626d5f3e80e3..8f1507765f934 100644
--- a/libclc/amdgcn/lib/workitem/get_global_size.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_global_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_size(uint dim) {
   switch (dim) {

diff  --git a/libclc/amdgcn/lib/workitem/get_group_id.cl b/libclc/opencl/lib/amdgcn/workitem/get_group_id.cl
similarity index 95%
rename from libclc/amdgcn/lib/workitem/get_group_id.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_group_id.cl
index d4ad33df95194..446cc63ab759d 100644
--- a/libclc/amdgcn/lib/workitem/get_group_id.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_group_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_group_id(uint dim) {
   switch (dim) {

diff  --git a/libclc/amdgcn/lib/workitem/get_local_id.cl b/libclc/opencl/lib/amdgcn/workitem/get_local_id.cl
similarity index 95%
rename from libclc/amdgcn/lib/workitem/get_local_id.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_local_id.cl
index 01709e0cf84ce..cd07d8645cd53 100644
--- a/libclc/amdgcn/lib/workitem/get_local_id.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_local_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_local_id(uint dim) {
   switch (dim) {

diff  --git a/libclc/amdgcn/lib/workitem/get_local_size.cl b/libclc/opencl/lib/amdgcn/workitem/get_local_size.cl
similarity index 96%
rename from libclc/amdgcn/lib/workitem/get_local_size.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_local_size.cl
index 9cb0dc7316a2c..cec2d358df8ac 100644
--- a/libclc/amdgcn/lib/workitem/get_local_size.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_local_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 uint __clc_amdgcn_get_local_size_x(void) __asm("llvm.r600.read.local.size.x");
 uint __clc_amdgcn_get_local_size_y(void) __asm("llvm.r600.read.local.size.y");

diff  --git a/libclc/amdgcn/lib/workitem/get_num_groups.cl b/libclc/opencl/lib/amdgcn/workitem/get_num_groups.cl
similarity index 96%
rename from libclc/amdgcn/lib/workitem/get_num_groups.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_num_groups.cl
index 90bcc328aa000..0d8f0b8736585 100644
--- a/libclc/amdgcn/lib/workitem/get_num_groups.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_num_groups.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 uint __clc_amdgcn_get_num_groups_x(void) __asm("llvm.r600.read.ngroups.x");
 uint __clc_amdgcn_get_num_groups_y(void) __asm("llvm.r600.read.ngroups.y");

diff  --git a/libclc/amdgcn/lib/workitem/get_work_dim.cl b/libclc/opencl/lib/amdgcn/workitem/get_work_dim.cl
similarity index 96%
rename from libclc/amdgcn/lib/workitem/get_work_dim.cl
rename to libclc/opencl/lib/amdgcn/workitem/get_work_dim.cl
index 2f6e3d3209508..8ca8b0b61ce54 100644
--- a/libclc/amdgcn/lib/workitem/get_work_dim.cl
+++ b/libclc/opencl/lib/amdgcn/workitem/get_work_dim.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #if __clang_major__ >= 8
 #define CONST_AS __constant

diff  --git a/libclc/opencl/lib/clspv/SOURCES b/libclc/opencl/lib/clspv/SOURCES
new file mode 100644
index 0000000000000..0a142ed3e6043
--- /dev/null
+++ b/libclc/opencl/lib/clspv/SOURCES
@@ -0,0 +1,73 @@
+math/fma.cl
+shared/vstore_half.cl
+subnormal_config.cl
+../generic/geometric/distance.cl
+../generic/geometric/length.cl
+../generic/math/acos.cl
+../generic/math/acosh.cl
+../generic/math/asinh.cl
+../generic/math/acospi.cl
+../generic/math/asin.cl
+../generic/math/atan.cl
+../generic/math/asinh.cl
+../generic/math/asinpi.cl
+../generic/math/atan2.cl
+../generic/math/atan2pi.cl
+../generic/math/atanh.cl
+../generic/math/atanpi.cl
+../generic/math/cbrt.cl
+../generic/math/cos.cl
+../generic/math/cosh.cl
+../generic/math/cospi.cl
+../generic/math/erf.cl
+../generic/math/erfc.cl
+../generic/math/exp.cl
+../generic/math/exp10.cl
+../generic/math/exp2.cl
+../generic/math/expm1.cl
+../generic/math/fdim.cl
+../generic/math/fmod.cl
+../generic/math/fract.cl
+../generic/math/frexp.cl
+../generic/math/half_cos.cl
+../generic/math/half_divide.cl
+../generic/math/half_exp.cl
+../generic/math/half_exp10.cl
+../generic/math/half_exp2.cl
+../generic/math/half_log.cl
+../generic/math/half_log10.cl
+../generic/math/half_log2.cl
+../generic/math/half_powr.cl
+../generic/math/half_recip.cl
+../generic/math/half_sin.cl
+../generic/math/half_sqrt.cl
+../generic/math/half_tan.cl
+../generic/math/hypot.cl
+../generic/math/ilogb.cl
+../generic/math/ldexp.cl
+../generic/math/lgamma.cl
+../generic/math/lgamma_r.cl
+../generic/math/log.cl
+../generic/math/log10.cl
+../generic/math/log1p.cl
+../generic/math/log2.cl
+../generic/math/logb.cl
+../generic/math/maxmag.cl
+../generic/math/minmag.cl
+../generic/math/modf.cl
+../generic/math/nan.cl
+../generic/math/nextafter.cl
+../generic/math/pow.cl
+../generic/math/pown.cl
+../generic/math/powr.cl
+../generic/math/remainder.cl
+../generic/math/remquo.cl
+../generic/math/rootn.cl
+../generic/math/sin.cl
+../generic/math/sincos.cl
+../generic/math/sinh.cl
+../generic/math/sinpi.cl
+../generic/math/tan.cl
+../generic/math/tanh.cl
+../generic/math/tanpi.cl
+../generic/math/tgamma.cl

diff  --git a/libclc/spirv/lib/math/fma.cl b/libclc/opencl/lib/clspv/math/fma.cl
similarity index 94%
rename from libclc/spirv/lib/math/fma.cl
rename to libclc/opencl/lib/clspv/math/fma.cl
index 0f3e4222dc557..2722018121224 100644
--- a/libclc/spirv/lib/math/fma.cl
+++ b/libclc/opencl/lib/clspv/math/fma.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/internal/math/clc_sw_fma.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_TERNARY_BUILTIN(float, fma, __clc_sw_fma, float, float, float)

diff  --git a/libclc/clspv/lib/shared/vstore_half.cl b/libclc/opencl/lib/clspv/shared/vstore_half.cl
similarity index 99%
rename from libclc/clspv/lib/shared/vstore_half.cl
rename to libclc/opencl/lib/clspv/shared/vstore_half.cl
index ee74e5d028fa1..1694ebeebe689 100644
--- a/libclc/clspv/lib/shared/vstore_half.cl
+++ b/libclc/opencl/lib/clspv/shared/vstore_half.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable
 

diff  --git a/libclc/clspv/lib/shared/vstore_half.inc b/libclc/opencl/lib/clspv/shared/vstore_half.inc
similarity index 100%
rename from libclc/clspv/lib/shared/vstore_half.inc
rename to libclc/opencl/lib/clspv/shared/vstore_half.inc

diff  --git a/libclc/spirv/lib/subnormal_config.cl b/libclc/opencl/lib/clspv/subnormal_config.cl
similarity index 95%
rename from libclc/spirv/lib/subnormal_config.cl
rename to libclc/opencl/lib/clspv/subnormal_config.cl
index ef0e1d7742447..77d60ab9cbbde 100644
--- a/libclc/spirv/lib/subnormal_config.cl
+++ b/libclc/opencl/lib/clspv/subnormal_config.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_subnormal_config.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF bool __clc_fp16_subnormals_supported() { return false; }
 

diff  --git a/libclc/generic/lib/SOURCES b/libclc/opencl/lib/generic/SOURCES
similarity index 100%
rename from libclc/generic/lib/SOURCES
rename to libclc/opencl/lib/generic/SOURCES

diff  --git a/libclc/generic/lib/async/async_work_group_copy.cl b/libclc/opencl/lib/generic/async/async_work_group_copy.cl
similarity index 95%
rename from libclc/generic/lib/async/async_work_group_copy.cl
rename to libclc/opencl/lib/generic/async/async_work_group_copy.cl
index 3ade4e9db9585..a0b9d7d1f52ec 100644
--- a/libclc/generic/lib/async/async_work_group_copy.cl
+++ b/libclc/opencl/lib/generic/async/async_work_group_copy.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <async_work_group_copy.inc>
 #include <clc/integer/gentype.inc>

diff  --git a/libclc/generic/lib/async/async_work_group_copy.inc b/libclc/opencl/lib/generic/async/async_work_group_copy.inc
similarity index 60%
rename from libclc/generic/lib/async/async_work_group_copy.inc
rename to libclc/opencl/lib/generic/async/async_work_group_copy.inc
index d21cc8e238bf3..f238ae6684424 100644
--- a/libclc/generic/lib/async/async_work_group_copy.inc
+++ b/libclc/opencl/lib/generic/async/async_work_group_copy.inc
@@ -6,20 +6,16 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DEF event_t async_work_group_copy(
-    local __CLC_GENTYPE *dst,
-    const global __CLC_GENTYPE *src,
-    size_t num_gentypes,
-    event_t event) {
+_CLC_OVERLOAD _CLC_DEF event_t
+async_work_group_copy(local __CLC_GENTYPE *dst, const global __CLC_GENTYPE *src,
+                      size_t num_gentypes, event_t event) {
 
   return async_work_group_strided_copy(dst, src, num_gentypes, 1, event);
 }
 
-_CLC_OVERLOAD _CLC_DEF event_t async_work_group_copy(
-    global __CLC_GENTYPE *dst,
-    const local __CLC_GENTYPE *src,
-    size_t num_gentypes,
-    event_t event) {
+_CLC_OVERLOAD _CLC_DEF event_t
+async_work_group_copy(global __CLC_GENTYPE *dst, const local __CLC_GENTYPE *src,
+                      size_t num_gentypes, event_t event) {
 
   return async_work_group_strided_copy(dst, src, num_gentypes, 1, event);
 }

diff  --git a/libclc/generic/lib/async/async_work_group_strided_copy.cl b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.cl
similarity index 95%
rename from libclc/generic/lib/async/async_work_group_strided_copy.cl
rename to libclc/opencl/lib/generic/async/async_work_group_strided_copy.cl
index 899ed0a4e3aa1..ac4d1da3bc215 100644
--- a/libclc/generic/lib/async/async_work_group_strided_copy.cl
+++ b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <async_work_group_strided_copy.inc>
 #include <clc/integer/gentype.inc>

diff  --git a/libclc/generic/lib/async/async_work_group_strided_copy.inc b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc
similarity index 67%
rename from libclc/generic/lib/async/async_work_group_strided_copy.inc
rename to libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc
index 218e7355ebb01..3a3f36a7d0426 100644
--- a/libclc/generic/lib/async/async_work_group_strided_copy.inc
+++ b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc
@@ -6,35 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define STRIDED_COPY(dst, src, num_gentypes, dst_stride, src_stride)       \
-  size_t size = get_local_size(0) * get_local_size(1) * get_local_size(2); \
-  size_t id = (get_local_size(1) * get_local_size(2) * get_local_id(0)) +  \
-              (get_local_size(2) * get_local_id(1)) +                      \
-              get_local_id(2);                                             \
-  size_t i;                                                                \
-                                                                           \
-  for (i = id; i < num_gentypes; i += size) {                              \
-    dst[i * dst_stride] = src[i * src_stride];                             \
+#define STRIDED_COPY(dst, src, num_gentypes, dst_stride, src_stride)           \
+  size_t size = get_local_size(0) * get_local_size(1) * get_local_size(2);     \
+  size_t id = (get_local_size(1) * get_local_size(2) * get_local_id(0)) +      \
+              (get_local_size(2) * get_local_id(1)) + get_local_id(2);         \
+  size_t i;                                                                    \
+                                                                               \
+  for (i = id; i < num_gentypes; i += size) {                                  \
+    dst[i * dst_stride] = src[i * src_stride];                                 \
   }
 
-
 _CLC_OVERLOAD _CLC_DEF event_t async_work_group_strided_copy(
-    local __CLC_GENTYPE *dst,
-    const global __CLC_GENTYPE *src,
-    size_t num_gentypes,
-    size_t src_stride,
-    event_t event) {
+    local __CLC_GENTYPE *dst, const global __CLC_GENTYPE *src,
+    size_t num_gentypes, size_t src_stride, event_t event) {
 
   STRIDED_COPY(dst, src, num_gentypes, 1, src_stride);
   return event;
 }
 
 _CLC_OVERLOAD _CLC_DEF event_t async_work_group_strided_copy(
-    global __CLC_GENTYPE *dst,
-    const local __CLC_GENTYPE *src,
-    size_t num_gentypes,
-    size_t dst_stride,
-    event_t event) {
+    global __CLC_GENTYPE *dst, const local __CLC_GENTYPE *src,
+    size_t num_gentypes, size_t dst_stride, event_t event) {
 
   STRIDED_COPY(dst, src, num_gentypes, dst_stride, 1);
   return event;

diff  --git a/libclc/generic/lib/async/prefetch.cl b/libclc/opencl/lib/generic/async/prefetch.cl
similarity index 94%
rename from libclc/generic/lib/async/prefetch.cl
rename to libclc/opencl/lib/generic/async/prefetch.cl
index 8c819d8210d9a..7903550e89e41 100644
--- a/libclc/generic/lib/async/prefetch.cl
+++ b/libclc/opencl/lib/generic/async/prefetch.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <prefetch.inc>
 #include <clc/integer/gentype.inc>

diff  --git a/libclc/generic/lib/async/prefetch.inc b/libclc/opencl/lib/generic/async/prefetch.inc
similarity index 86%
rename from libclc/generic/lib/async/prefetch.inc
rename to libclc/opencl/lib/generic/async/prefetch.inc
index a9bca307c3d02..b952c532dc284 100644
--- a/libclc/generic/lib/async/prefetch.inc
+++ b/libclc/opencl/lib/generic/async/prefetch.inc
@@ -6,4 +6,5 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DEF void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes) { }
+_CLC_OVERLOAD _CLC_DEF void prefetch(const global __CLC_GENTYPE *p,
+                                     size_t num_gentypes) {}

diff  --git a/libclc/generic/lib/async/wait_group_events.cl b/libclc/opencl/lib/generic/async/wait_group_events.cl
similarity index 95%
rename from libclc/generic/lib/async/wait_group_events.cl
rename to libclc/opencl/lib/generic/async/wait_group_events.cl
index 09c989cdb5ee4..e353e48cfe09f 100644
--- a/libclc/generic/lib/async/wait_group_events.cl
+++ b/libclc/opencl/lib/generic/async/wait_group_events.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD void wait_group_events(int num_events,
                                               event_t *event_list) {

diff  --git a/libclc/generic/lib/atomic/atom_add.cl b/libclc/opencl/lib/generic/atomic/atom_add.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_add.cl
rename to libclc/opencl/lib/generic/atomic/atom_add.cl
index 282b24dcbd1c9..9f60881c2717d 100644
--- a/libclc/generic/lib/atomic/atom_add.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_add.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_add.h>
+#include <clc/opencl/atomic/atom_add.h>
 
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_ATOMIC_OP add

diff  --git a/libclc/generic/lib/atomic/atom_and.cl b/libclc/opencl/lib/generic/atomic/atom_and.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_and.cl
rename to libclc/opencl/lib/generic/atomic/atom_and.cl
index 2c95d2a7780c3..2653296d29e4f 100644
--- a/libclc/generic/lib/atomic/atom_and.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_and.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_and.h>
+#include <clc/opencl/atomic/atom_and.h>
 
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_ATOMIC_OP and

diff  --git a/libclc/generic/lib/atomic/atom_cmpxchg.cl b/libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl
similarity index 94%
rename from libclc/generic/lib/atomic/atom_cmpxchg.cl
rename to libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl
index e29707af84cb3..f129be9809e51 100644
--- a/libclc/generic/lib/atomic/atom_cmpxchg.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_cmpxchg.h>
-#include <clc/atomic/atomic_cmpxchg.h>
+#include <clc/opencl/atomic/atom_cmpxchg.h>
+#include <clc/opencl/atomic/atomic_cmpxchg.h>
 
 #define IMPL(AS, TYPE)                                                         \
   _CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile AS TYPE *p, TYPE cmp,      \

diff  --git a/libclc/generic/lib/atomic/atom_dec.cl b/libclc/opencl/lib/generic/atomic/atom_dec.cl
similarity index 91%
rename from libclc/generic/lib/atomic/atom_dec.cl
rename to libclc/opencl/lib/generic/atomic/atom_dec.cl
index 8fb5495397d69..2df721cae365a 100644
--- a/libclc/generic/lib/atomic/atom_dec.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_dec.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_dec.h>
-#include <clc/atomic/atom_sub.h>
-#include <clc/atomic/atomic_dec.h>
+#include <clc/opencl/atomic/atom_dec.h>
+#include <clc/opencl/atomic/atom_sub.h>
+#include <clc/opencl/atomic/atomic_dec.h>
 
 #define IMPL(AS, TYPE)                                                         \
   _CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile AS TYPE *p) {                  \

diff  --git a/libclc/generic/lib/atomic/atom_inc.cl b/libclc/opencl/lib/generic/atomic/atom_inc.cl
similarity index 91%
rename from libclc/generic/lib/atomic/atom_inc.cl
rename to libclc/opencl/lib/generic/atomic/atom_inc.cl
index c74df54eb4893..dc7699a478020 100644
--- a/libclc/generic/lib/atomic/atom_inc.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_inc.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_add.h>
-#include <clc/atomic/atom_inc.h>
-#include <clc/atomic/atomic_inc.h>
+#include <clc/opencl/atomic/atom_add.h>
+#include <clc/opencl/atomic/atom_inc.h>
+#include <clc/opencl/atomic/atomic_inc.h>
 
 #define IMPL(AS, TYPE)                                                         \
   _CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile AS TYPE *p) {                  \

diff  --git a/libclc/generic/lib/atomic/atom_int32_binary.inc b/libclc/opencl/lib/generic/atomic/atom_int32_binary.inc
similarity index 96%
rename from libclc/generic/lib/atomic/atom_int32_binary.inc
rename to libclc/opencl/lib/generic/atomic/atom_int32_binary.inc
index 81e6a8ebc7c8a..bee20d9146420 100644
--- a/libclc/generic/lib/atomic/atom_int32_binary.inc
+++ b/libclc/opencl/lib/generic/atomic/atom_int32_binary.inc
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/utils.h>
 
 #define __CLC_ATOM_IMPL(AS, TYPE)                                              \

diff  --git a/libclc/generic/lib/atomic/atom_max.cl b/libclc/opencl/lib/generic/atomic/atom_max.cl
similarity index 97%
rename from libclc/generic/lib/atomic/atom_max.cl
rename to libclc/opencl/lib/generic/atomic/atom_max.cl
index 9427732fe7a4d..744f39f6cb494 100644
--- a/libclc/generic/lib/atomic/atom_max.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_max.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_max.h>
+#include <clc/opencl/atomic/atom_max.h>
 
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_ATOMIC_OP max

diff  --git a/libclc/generic/lib/atomic/atom_min.cl b/libclc/opencl/lib/generic/atomic/atom_min.cl
similarity index 97%
rename from libclc/generic/lib/atomic/atom_min.cl
rename to libclc/opencl/lib/generic/atomic/atom_min.cl
index 881e832932910..75e5fb02e1289 100644
--- a/libclc/generic/lib/atomic/atom_min.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_min.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_min.h>
+#include <clc/opencl/atomic/atom_min.h>
 
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_ATOMIC_OP min

diff  --git a/libclc/generic/lib/atomic/atom_or.cl b/libclc/opencl/lib/generic/atomic/atom_or.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_or.cl
rename to libclc/opencl/lib/generic/atomic/atom_or.cl
index a9f9bb782fb2f..4b1ecac95d878 100644
--- a/libclc/generic/lib/atomic/atom_or.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_or.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_or.h>
+#include <clc/opencl/atomic/atom_or.h>
 
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_ATOMIC_OP or

diff  --git a/libclc/generic/lib/atomic/atom_sub.cl b/libclc/opencl/lib/generic/atomic/atom_sub.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_sub.cl
rename to libclc/opencl/lib/generic/atomic/atom_sub.cl
index 1951f985688b2..24c7e85ca73a2 100644
--- a/libclc/generic/lib/atomic/atom_sub.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_sub.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_sub.h>
+#include <clc/opencl/atomic/atom_sub.h>
 
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_ATOMIC_OP sub

diff  --git a/libclc/generic/lib/atomic/atom_xchg.cl b/libclc/opencl/lib/generic/atomic/atom_xchg.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_xchg.cl
rename to libclc/opencl/lib/generic/atomic/atom_xchg.cl
index 6e9ef796d9c0d..f14b18070deb0 100644
--- a/libclc/generic/lib/atomic/atom_xchg.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_xchg.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_xchg.h>
+#include <clc/opencl/atomic/atom_xchg.h>
 
 #ifdef cl_khr_global_int32_base_atomics
 #define __CLC_ATOMIC_OP xchg

diff  --git a/libclc/generic/lib/atomic/atom_xor.cl b/libclc/opencl/lib/generic/atomic/atom_xor.cl
similarity index 96%
rename from libclc/generic/lib/atomic/atom_xor.cl
rename to libclc/opencl/lib/generic/atomic/atom_xor.cl
index bfa978d4b9a12..9373fae2487de 100644
--- a/libclc/generic/lib/atomic/atom_xor.cl
+++ b/libclc/opencl/lib/generic/atomic/atom_xor.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/atomic/atom_xor.h>
+#include <clc/opencl/atomic/atom_xor.h>
 
 #ifdef cl_khr_global_int32_extended_atomics
 #define __CLC_ATOMIC_OP xor

diff  --git a/libclc/generic/lib/atomic/atomic_add.cl b/libclc/opencl/lib/generic/atomic/atomic_add.cl
similarity index 63%
rename from libclc/generic/lib/atomic/atomic_add.cl
rename to libclc/opencl/lib/generic/atomic/atomic_add.cl
index 0f8a7e1d98800..cb3935cc4f8a1 100644
--- a/libclc/generic/lib/atomic/atomic_add.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_add.cl
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_add(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_add(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_add(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_add(p, val);                                       \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)

diff  --git a/libclc/generic/lib/atomic/atomic_and.cl b/libclc/opencl/lib/generic/atomic/atomic_and.cl
similarity index 63%
rename from libclc/generic/lib/atomic/atomic_and.cl
rename to libclc/opencl/lib/generic/atomic/atomic_and.cl
index a151a8daf4645..f5b6e97246c6b 100644
--- a/libclc/generic/lib/atomic/atomic_and.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_and.cl
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_and(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_and(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_and(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_and(p, val);                                       \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)

diff  --git a/libclc/generic/lib/atomic/atomic_cmpxchg.cl b/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl
similarity index 57%
rename from libclc/generic/lib/atomic/atomic_cmpxchg.cl
rename to libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl
index 0541007535ce9..c2227ea5207df 100644
--- a/libclc/generic/lib/atomic/atomic_cmpxchg.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl
@@ -6,12 +6,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_cmpxchg(volatile AS TYPE *p, TYPE cmp, TYPE val) { \
-  return __sync_val_compare_and_swap(p, cmp, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_cmpxchg(volatile AS TYPE *p, TYPE cmp,    \
+                                             TYPE val) {                       \
+    return __sync_val_compare_and_swap(p, cmp, val);                           \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)

diff  --git a/libclc/generic/lib/atomic/atomic_dec.cl b/libclc/opencl/lib/generic/atomic/atomic_dec.cl
similarity index 63%
rename from libclc/generic/lib/atomic/atomic_dec.cl
rename to libclc/opencl/lib/generic/atomic/atomic_dec.cl
index 4ebfd11e8dff8..d67f6382fd07d 100644
--- a/libclc/generic/lib/atomic/atomic_dec.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_dec.cl
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_dec(volatile AS TYPE *p) { \
-  return __sync_fetch_and_sub(p, (TYPE)1); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_dec(volatile AS TYPE *p) {                \
+    return __sync_fetch_and_sub(p, (TYPE)1);                                   \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)

diff  --git a/libclc/generic/lib/atomic/atomic_inc.cl b/libclc/opencl/lib/generic/atomic/atomic_inc.cl
similarity index 63%
rename from libclc/generic/lib/atomic/atomic_inc.cl
rename to libclc/opencl/lib/generic/atomic/atomic_inc.cl
index c9820fd4c78c4..989c45c0e5d8a 100644
--- a/libclc/generic/lib/atomic/atomic_inc.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_inc.cl
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_inc(volatile AS TYPE *p) { \
-  return __sync_fetch_and_add(p, (TYPE)1); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_inc(volatile AS TYPE *p) {                \
+    return __sync_fetch_and_add(p, (TYPE)1);                                   \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)

diff  --git a/libclc/generic/lib/atomic/atomic_max.cl b/libclc/opencl/lib/generic/atomic/atomic_max.cl
similarity index 64%
rename from libclc/generic/lib/atomic/atomic_max.cl
rename to libclc/opencl/lib/generic/atomic/atomic_max.cl
index 698d8d713b7e1..dbd5aa049c5e7 100644
--- a/libclc/generic/lib/atomic/atomic_max.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_max.cl
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS, OP) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_max(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_##OP(p, val); \
-}
+#define IMPL(TYPE, AS, OP)                                                     \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_max(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_##OP(p, val);                                      \
+  }
 
 IMPL(int, global, max)
 IMPL(unsigned int, global, umax)

diff  --git a/libclc/generic/lib/atomic/atomic_min.cl b/libclc/opencl/lib/generic/atomic/atomic_min.cl
similarity index 64%
rename from libclc/generic/lib/atomic/atomic_min.cl
rename to libclc/opencl/lib/generic/atomic/atomic_min.cl
index c0a7e3b92840a..d43f74c82ffc5 100644
--- a/libclc/generic/lib/atomic/atomic_min.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_min.cl
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS, OP) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_min(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_##OP(p, val); \
-}
+#define IMPL(TYPE, AS, OP)                                                     \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_min(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_##OP(p, val);                                      \
+  }
 
 IMPL(int, global, min)
 IMPL(unsigned int, global, umin)

diff  --git a/libclc/generic/lib/atomic/atomic_or.cl b/libclc/opencl/lib/generic/atomic/atomic_or.cl
similarity index 63%
rename from libclc/generic/lib/atomic/atomic_or.cl
rename to libclc/opencl/lib/generic/atomic/atomic_or.cl
index 0ec0792703ff5..dac7eb66033b4 100644
--- a/libclc/generic/lib/atomic/atomic_or.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_or.cl
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_or(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_or(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_or(volatile AS TYPE *p, TYPE val) {       \
+    return __sync_fetch_and_or(p, val);                                        \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)

diff  --git a/libclc/generic/lib/atomic/atomic_sub.cl b/libclc/opencl/lib/generic/atomic/atomic_sub.cl
similarity index 63%
rename from libclc/generic/lib/atomic/atomic_sub.cl
rename to libclc/opencl/lib/generic/atomic/atomic_sub.cl
index 8e43e8594558a..5ebe1f0b13694 100644
--- a/libclc/generic/lib/atomic/atomic_sub.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_sub.cl
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_sub(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_sub(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_sub(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_sub(p, val);                                       \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)

diff  --git a/libclc/generic/lib/atomic/atomic_xchg.cl b/libclc/opencl/lib/generic/atomic/atomic_xchg.cl
similarity index 73%
rename from libclc/generic/lib/atomic/atomic_xchg.cl
rename to libclc/opencl/lib/generic/atomic/atomic_xchg.cl
index 464f23f08806f..b3f631c21aec3 100644
--- a/libclc/generic/lib/atomic/atomic_xchg.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_xchg.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF float atomic_xchg(volatile global float *p, float val) {
   return as_float(atomic_xchg((volatile global uint *)p, as_uint(val)));
@@ -16,10 +16,10 @@ _CLC_OVERLOAD _CLC_DEF float atomic_xchg(volatile local float *p, float val) {
   return as_float(atomic_xchg((volatile local uint *)p, as_uint(val)));
 }
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_xchg(volatile AS TYPE *p, TYPE val) { \
-  return __sync_swap_4(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_xchg(volatile AS TYPE *p, TYPE val) {     \
+    return __sync_swap_4(p, val);                                              \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)

diff  --git a/libclc/generic/lib/atomic/atomic_xor.cl b/libclc/opencl/lib/generic/atomic/atomic_xor.cl
similarity index 63%
rename from libclc/generic/lib/atomic/atomic_xor.cl
rename to libclc/opencl/lib/generic/atomic/atomic_xor.cl
index b2f7594dd36e6..864e22b774538 100644
--- a/libclc/generic/lib/atomic/atomic_xor.cl
+++ b/libclc/opencl/lib/generic/atomic/atomic_xor.cl
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-#define IMPL(TYPE, AS) \
-_CLC_OVERLOAD _CLC_DEF TYPE atomic_xor(volatile AS TYPE *p, TYPE val) { \
-  return __sync_fetch_and_xor(p, val); \
-}
+#define IMPL(TYPE, AS)                                                         \
+  _CLC_OVERLOAD _CLC_DEF TYPE atomic_xor(volatile AS TYPE *p, TYPE val) {      \
+    return __sync_fetch_and_xor(p, val);                                       \
+  }
 
 IMPL(int, global)
 IMPL(unsigned int, global)

diff  --git a/libclc/generic/lib/common/degrees.cl b/libclc/opencl/lib/generic/common/degrees.cl
similarity index 96%
rename from libclc/generic/lib/common/degrees.cl
rename to libclc/opencl/lib/generic/common/degrees.cl
index a6e77457fd445..8b17fe4321297 100644
--- a/libclc/generic/lib/common/degrees.cl
+++ b/libclc/opencl/lib/generic/common/degrees.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_degrees.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_UNARY_BUILTIN(float, degrees, __clc_degrees, float)
 

diff  --git a/libclc/generic/lib/common/mix.cl b/libclc/opencl/lib/generic/common/mix.cl
similarity index 94%
rename from libclc/generic/lib/common/mix.cl
rename to libclc/opencl/lib/generic/common/mix.cl
index 5a365e073230b..cc95dcd3b615c 100644
--- a/libclc/generic/lib/common/mix.cl
+++ b/libclc/opencl/lib/generic/common/mix.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_mad.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <mix.inc>
 #include <clc/math/gentype.inc>

diff  --git a/libclc/generic/lib/common/mix.inc b/libclc/opencl/lib/generic/common/mix.inc
similarity index 100%
rename from libclc/generic/lib/common/mix.inc
rename to libclc/opencl/lib/generic/common/mix.inc

diff  --git a/libclc/generic/lib/common/radians.cl b/libclc/opencl/lib/generic/common/radians.cl
similarity index 96%
rename from libclc/generic/lib/common/radians.cl
rename to libclc/opencl/lib/generic/common/radians.cl
index 17caa948939fb..1c58c6c4da6f3 100644
--- a/libclc/generic/lib/common/radians.cl
+++ b/libclc/opencl/lib/generic/common/radians.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_radians.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_UNARY_BUILTIN(float, radians, __clc_radians, float)
 

diff  --git a/libclc/generic/lib/common/sign.cl b/libclc/opencl/lib/generic/common/sign.cl
similarity index 94%
rename from libclc/generic/lib/common/sign.cl
rename to libclc/opencl/lib/generic/common/sign.cl
index b33cdac3001d3..0acab050af598 100644
--- a/libclc/generic/lib/common/sign.cl
+++ b/libclc/opencl/lib/generic/common/sign.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_sign.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sign
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/common/smoothstep.cl b/libclc/opencl/lib/generic/common/smoothstep.cl
similarity index 99%
rename from libclc/generic/lib/common/smoothstep.cl
rename to libclc/opencl/lib/generic/common/smoothstep.cl
index 16bf1b2ce9522..30ed1451ff302 100644
--- a/libclc/generic/lib/common/smoothstep.cl
+++ b/libclc/opencl/lib/generic/common/smoothstep.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/common/clc_smoothstep.h>
+#include <clc/opencl/clc.h>
 
 #define SMOOTHSTEP_SINGLE_DEF(X_TYPE)                                          \
   _CLC_OVERLOAD _CLC_DEF X_TYPE smoothstep(X_TYPE edge0, X_TYPE edge1,         \

diff  --git a/libclc/generic/lib/common/step.cl b/libclc/opencl/lib/generic/common/step.cl
similarity index 84%
rename from libclc/generic/lib/common/step.cl
rename to libclc/opencl/lib/generic/common/step.cl
index 4bf1166245773..99e69963c37ba 100644
--- a/libclc/generic/lib/common/step.cl
+++ b/libclc/opencl/lib/generic/common/step.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF float step(float edge, float x) {
   return x < edge ? 0.0f : 1.0f;
@@ -20,10 +20,10 @@ _CLC_V_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, step, float, float);
 #ifdef cl_khr_fp64
 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
 
-#define STEP_DEF(edge_type, x_type) \
-  _CLC_OVERLOAD _CLC_DEF x_type step(edge_type edge, x_type x) { \
-    return x < edge ? 0.0 : 1.0; \
- }
+#define STEP_DEF(edge_type, x_type)                                            \
+  _CLC_OVERLOAD _CLC_DEF x_type step(edge_type edge, x_type x) {               \
+    return x < edge ? 0.0 : 1.0;                                               \
+  }
 
 STEP_DEF(double, double);
 

diff  --git a/libclc/generic/lib/geometric/cross.cl b/libclc/opencl/lib/generic/geometric/cross.cl
similarity index 97%
rename from libclc/generic/lib/geometric/cross.cl
rename to libclc/opencl/lib/generic/geometric/cross.cl
index 842670bb3e808..bd4f86bb15d84 100644
--- a/libclc/generic/lib/geometric/cross.cl
+++ b/libclc/opencl/lib/generic/geometric/cross.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/geometric/clc_cross.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF float3 cross(float3 p0, float3 p1) {
   return __clc_cross(p0, p1);

diff  --git a/libclc/generic/lib/geometric/distance.cl b/libclc/opencl/lib/generic/geometric/distance.cl
similarity index 94%
rename from libclc/generic/lib/geometric/distance.cl
rename to libclc/opencl/lib/generic/geometric/distance.cl
index 2416ad1352aaf..b2194abd60e97 100644
--- a/libclc/generic/lib/geometric/distance.cl
+++ b/libclc/opencl/lib/generic/geometric/distance.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/geometric/clc_distance.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION distance
 #define __CLC_BODY <clc/geometric/binary_def.inc>

diff  --git a/libclc/generic/lib/geometric/dot.cl b/libclc/opencl/lib/generic/geometric/dot.cl
similarity index 98%
rename from libclc/generic/lib/geometric/dot.cl
rename to libclc/opencl/lib/generic/geometric/dot.cl
index 60469c94d47b3..72d30ea53f8cf 100644
--- a/libclc/generic/lib/geometric/dot.cl
+++ b/libclc/opencl/lib/generic/geometric/dot.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/geometric/clc_dot.h>
+#include <clc/opencl/clc.h>
 
 _CLC_OVERLOAD _CLC_DEF float dot(float p0, float p1) {
   return __clc_dot(p0, p1);

diff  --git a/libclc/generic/lib/geometric/fast_distance.cl b/libclc/opencl/lib/generic/geometric/fast_distance.cl
similarity index 95%
rename from libclc/generic/lib/geometric/fast_distance.cl
rename to libclc/opencl/lib/generic/geometric/fast_distance.cl
index 589c79496506e..2a19418a175b9 100644
--- a/libclc/generic/lib/geometric/fast_distance.cl
+++ b/libclc/opencl/lib/generic/geometric/fast_distance.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/geometric/clc_fast_distance.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION fast_distance

diff  --git a/libclc/generic/lib/geometric/fast_length.cl b/libclc/opencl/lib/generic/geometric/fast_length.cl
similarity index 95%
rename from libclc/generic/lib/geometric/fast_length.cl
rename to libclc/opencl/lib/generic/geometric/fast_length.cl
index 11e8172998053..3af751af5425d 100644
--- a/libclc/generic/lib/geometric/fast_length.cl
+++ b/libclc/opencl/lib/generic/geometric/fast_length.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/geometric/clc_fast_length.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION fast_length

diff  --git a/libclc/generic/lib/geometric/fast_normalize.cl b/libclc/opencl/lib/generic/geometric/fast_normalize.cl
similarity index 82%
rename from libclc/generic/lib/geometric/fast_normalize.cl
rename to libclc/opencl/lib/generic/geometric/fast_normalize.cl
index 585400d2200fd..d6d140f3c406d 100644
--- a/libclc/generic/lib/geometric/fast_normalize.cl
+++ b/libclc/opencl/lib/generic/geometric/fast_normalize.cl
@@ -6,11 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-_CLC_OVERLOAD _CLC_DEF float fast_normalize(float p) {
-  return normalize(p);
-}
+_CLC_OVERLOAD _CLC_DEF float fast_normalize(float p) { return normalize(p); }
 
 #define __CLC_BODY <fast_normalize.inc>
 #define __FLOAT_ONLY

diff  --git a/libclc/generic/lib/geometric/fast_normalize.inc b/libclc/opencl/lib/generic/geometric/fast_normalize.inc
similarity index 100%
rename from libclc/generic/lib/geometric/fast_normalize.inc
rename to libclc/opencl/lib/generic/geometric/fast_normalize.inc

diff  --git a/libclc/generic/lib/geometric/length.cl b/libclc/opencl/lib/generic/geometric/length.cl
similarity index 94%
rename from libclc/generic/lib/geometric/length.cl
rename to libclc/opencl/lib/generic/geometric/length.cl
index 3a4e286e9a0fb..5645ade4c9172 100644
--- a/libclc/generic/lib/geometric/length.cl
+++ b/libclc/opencl/lib/generic/geometric/length.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/geometric/clc_length.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION length
 #define __CLC_BODY <clc/geometric/unary_def.inc>

diff  --git a/libclc/generic/lib/geometric/normalize.cl b/libclc/opencl/lib/generic/geometric/normalize.cl
similarity index 94%
rename from libclc/generic/lib/geometric/normalize.cl
rename to libclc/opencl/lib/generic/geometric/normalize.cl
index 36c1f64687536..e1e51b306a1ba 100644
--- a/libclc/generic/lib/geometric/normalize.cl
+++ b/libclc/opencl/lib/generic/geometric/normalize.cl
@@ -6,11 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-_CLC_OVERLOAD _CLC_DEF float normalize(float p) {
-  return sign(p);
-}
+_CLC_OVERLOAD _CLC_DEF float normalize(float p) { return sign(p); }
 
 _CLC_OVERLOAD _CLC_DEF float2 normalize(float2 p) {
   if (all(p == (float2)0.0F))
@@ -76,9 +74,7 @@ _CLC_OVERLOAD _CLC_DEF float4 normalize(float4 p) {
 
 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
 
-_CLC_OVERLOAD _CLC_DEF double normalize(double p) {
-  return sign(p);
-}
+_CLC_OVERLOAD _CLC_DEF double normalize(double p) { return sign(p); }
 
 _CLC_OVERLOAD _CLC_DEF double2 normalize(double2 p) {
   if (all(p == (double2)0.0))

diff  --git a/libclc/generic/lib/integer/abs.cl b/libclc/opencl/lib/generic/integer/abs.cl
similarity index 94%
rename from libclc/generic/lib/integer/abs.cl
rename to libclc/opencl/lib/generic/integer/abs.cl
index 7a7aa32e27844..5d354d97e71c5 100644
--- a/libclc/generic/lib/integer/abs.cl
+++ b/libclc/opencl/lib/generic/integer/abs.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_abs.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <abs.inc>
 #include <clc/integer/gentype.inc>

diff  --git a/libclc/generic/lib/integer/abs.inc b/libclc/opencl/lib/generic/integer/abs.inc
similarity index 100%
rename from libclc/generic/lib/integer/abs.inc
rename to libclc/opencl/lib/generic/integer/abs.inc

diff  --git a/libclc/generic/lib/integer/abs_
diff .cl b/libclc/opencl/lib/generic/integer/abs_
diff .cl
similarity index 94%
rename from libclc/generic/lib/integer/abs_
diff .cl
rename to libclc/opencl/lib/generic/integer/abs_
diff .cl
index 552f61e1d1ae6..73d6631b3a4a3 100644
--- a/libclc/generic/lib/integer/abs_
diff .cl
+++ b/libclc/opencl/lib/generic/integer/abs_
diff .cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_abs_
diff .h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <abs_
diff .inc>
 #include <clc/integer/gentype.inc>

diff  --git a/libclc/generic/lib/integer/abs_
diff .inc b/libclc/opencl/lib/generic/integer/abs_
diff .inc
similarity index 87%
rename from libclc/generic/lib/integer/abs_
diff .inc
rename to libclc/opencl/lib/generic/integer/abs_
diff .inc
index 57de34422b183..0f515202cd899 100644
--- a/libclc/generic/lib/integer/abs_
diff .inc
+++ b/libclc/opencl/lib/generic/integer/abs_
diff .inc
@@ -6,6 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DEF __CLC_U_GENTYPE abs_
diff (__CLC_GENTYPE x, __CLC_GENTYPE y) {
+_CLC_OVERLOAD _CLC_DEF __CLC_U_GENTYPE abs_
diff (__CLC_GENTYPE x,
+                                                __CLC_GENTYPE y) {
   return __clc_abs_
diff (x, y);
 }

diff  --git a/libclc/generic/lib/integer/add_sat.cl b/libclc/opencl/lib/generic/integer/add_sat.cl
similarity index 94%
rename from libclc/generic/lib/integer/add_sat.cl
rename to libclc/opencl/lib/generic/integer/add_sat.cl
index 080cc6d57f7d6..8fe1d32a82216 100644
--- a/libclc/generic/lib/integer/add_sat.cl
+++ b/libclc/opencl/lib/generic/integer/add_sat.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_add_sat.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION add_sat
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/integer/clz.cl b/libclc/opencl/lib/generic/integer/clz.cl
similarity index 94%
rename from libclc/generic/lib/integer/clz.cl
rename to libclc/opencl/lib/generic/integer/clz.cl
index bc2e7e2a29129..cf12a9838c6d7 100644
--- a/libclc/generic/lib/integer/clz.cl
+++ b/libclc/opencl/lib/generic/integer/clz.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_clz.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION clz
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/integer/ctz.cl b/libclc/opencl/lib/generic/integer/ctz.cl
similarity index 95%
rename from libclc/generic/lib/integer/ctz.cl
rename to libclc/opencl/lib/generic/integer/ctz.cl
index 44978e1617403..1b0470e08fd36 100644
--- a/libclc/generic/lib/integer/ctz.cl
+++ b/libclc/opencl/lib/generic/integer/ctz.cl
@@ -8,8 +8,8 @@
 
 #if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
 
-#include <clc/clc.h>
 #include <clc/integer/clc_ctz.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION ctz
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/integer/hadd.cl b/libclc/opencl/lib/generic/integer/hadd.cl
similarity index 94%
rename from libclc/generic/lib/integer/hadd.cl
rename to libclc/opencl/lib/generic/integer/hadd.cl
index b89e17463f07c..100cb7bf207a5 100644
--- a/libclc/generic/lib/integer/hadd.cl
+++ b/libclc/opencl/lib/generic/integer/hadd.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_hadd.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION hadd
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/integer/mad24.cl b/libclc/opencl/lib/generic/integer/mad24.cl
similarity index 94%
rename from libclc/generic/lib/integer/mad24.cl
rename to libclc/opencl/lib/generic/integer/mad24.cl
index 59aea1baa33b7..d42873f1dd15e 100644
--- a/libclc/generic/lib/integer/mad24.cl
+++ b/libclc/opencl/lib/generic/integer/mad24.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_mad24.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION mad24
 #define __CLC_BODY <clc/shared/ternary_def.inc>

diff  --git a/libclc/generic/lib/integer/mad_hi.cl b/libclc/opencl/lib/generic/integer/mad_hi.cl
similarity index 94%
rename from libclc/generic/lib/integer/mad_hi.cl
rename to libclc/opencl/lib/generic/integer/mad_hi.cl
index 5fa3a44ea4ee0..68e610d400cc1 100644
--- a/libclc/generic/lib/integer/mad_hi.cl
+++ b/libclc/opencl/lib/generic/integer/mad_hi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_mad_hi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION mad_hi
 #define __CLC_BODY <clc/shared/ternary_def.inc>

diff  --git a/libclc/generic/lib/integer/mad_sat.cl b/libclc/opencl/lib/generic/integer/mad_sat.cl
similarity index 94%
rename from libclc/generic/lib/integer/mad_sat.cl
rename to libclc/opencl/lib/generic/integer/mad_sat.cl
index d7a933313700a..d9daf56632b07 100644
--- a/libclc/generic/lib/integer/mad_sat.cl
+++ b/libclc/opencl/lib/generic/integer/mad_sat.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_mad_sat.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION mad_sat
 #define __CLC_BODY <clc/shared/ternary_def.inc>

diff  --git a/libclc/generic/lib/integer/mul24.cl b/libclc/opencl/lib/generic/integer/mul24.cl
similarity index 94%
rename from libclc/generic/lib/integer/mul24.cl
rename to libclc/opencl/lib/generic/integer/mul24.cl
index ec32ada5d6c67..b0a9ff80f3528 100644
--- a/libclc/generic/lib/integer/mul24.cl
+++ b/libclc/opencl/lib/generic/integer/mul24.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_mul24.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION mul24
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/integer/mul_hi.cl b/libclc/opencl/lib/generic/integer/mul_hi.cl
similarity index 94%
rename from libclc/generic/lib/integer/mul_hi.cl
rename to libclc/opencl/lib/generic/integer/mul_hi.cl
index 152bc3fa72c9a..40cb359f5b296 100644
--- a/libclc/generic/lib/integer/mul_hi.cl
+++ b/libclc/opencl/lib/generic/integer/mul_hi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_mul_hi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION mul_hi
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/integer/popcount.cl b/libclc/opencl/lib/generic/integer/popcount.cl
similarity index 94%
rename from libclc/generic/lib/integer/popcount.cl
rename to libclc/opencl/lib/generic/integer/popcount.cl
index 35f57f50c8015..a349f454813ef 100644
--- a/libclc/generic/lib/integer/popcount.cl
+++ b/libclc/opencl/lib/generic/integer/popcount.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_popcount.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION popcount
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/integer/rhadd.cl b/libclc/opencl/lib/generic/integer/rhadd.cl
similarity index 94%
rename from libclc/generic/lib/integer/rhadd.cl
rename to libclc/opencl/lib/generic/integer/rhadd.cl
index 86d3286658b40..539def845488d 100644
--- a/libclc/generic/lib/integer/rhadd.cl
+++ b/libclc/opencl/lib/generic/integer/rhadd.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_rhadd.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION rhadd
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/integer/rotate.cl b/libclc/opencl/lib/generic/integer/rotate.cl
similarity index 94%
rename from libclc/generic/lib/integer/rotate.cl
rename to libclc/opencl/lib/generic/integer/rotate.cl
index 8de40e84e24fa..a340ccf77b2ea 100644
--- a/libclc/generic/lib/integer/rotate.cl
+++ b/libclc/opencl/lib/generic/integer/rotate.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_rotate.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION rotate
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/integer/sub_sat.cl b/libclc/opencl/lib/generic/integer/sub_sat.cl
similarity index 94%
rename from libclc/generic/lib/integer/sub_sat.cl
rename to libclc/opencl/lib/generic/integer/sub_sat.cl
index 7938376acb5a9..46596724358ab 100644
--- a/libclc/generic/lib/integer/sub_sat.cl
+++ b/libclc/opencl/lib/generic/integer/sub_sat.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_sub_sat.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sub_sat
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/integer/upsample.cl b/libclc/opencl/lib/generic/integer/upsample.cl
similarity index 98%
rename from libclc/generic/lib/integer/upsample.cl
rename to libclc/opencl/lib/generic/integer/upsample.cl
index 46831f5db2afb..32cb3cffc9ebd 100644
--- a/libclc/generic/lib/integer/upsample.cl
+++ b/libclc/opencl/lib/generic/integer/upsample.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/integer/clc_upsample.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_UPSAMPLE_IMPL(BGENTYPE, GENTYPE, UGENTYPE)                       \
   _CLC_OVERLOAD _CLC_DEF BGENTYPE upsample(GENTYPE hi, UGENTYPE lo) {          \

diff  --git a/libclc/generic/lib/math/acos.cl b/libclc/opencl/lib/generic/math/acos.cl
similarity index 94%
rename from libclc/generic/lib/math/acos.cl
rename to libclc/opencl/lib/generic/math/acos.cl
index 85119b437b4cd..3d290225a2c29 100644
--- a/libclc/generic/lib/math/acos.cl
+++ b/libclc/opencl/lib/generic/math/acos.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_acos.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION acos
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/acosh.cl b/libclc/opencl/lib/generic/math/acosh.cl
similarity index 94%
rename from libclc/generic/lib/math/acosh.cl
rename to libclc/opencl/lib/generic/math/acosh.cl
index 7df6b87703f5f..fea40caa3e20c 100644
--- a/libclc/generic/lib/math/acosh.cl
+++ b/libclc/opencl/lib/generic/math/acosh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_acosh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION acosh
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/acospi.cl b/libclc/opencl/lib/generic/math/acospi.cl
similarity index 94%
rename from libclc/generic/lib/math/acospi.cl
rename to libclc/opencl/lib/generic/math/acospi.cl
index d8e774481d412..6c5ba2982ed0b 100644
--- a/libclc/generic/lib/math/acospi.cl
+++ b/libclc/opencl/lib/generic/math/acospi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_acospi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION acospi
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/asin.cl b/libclc/opencl/lib/generic/math/asin.cl
similarity index 94%
rename from libclc/generic/lib/math/asin.cl
rename to libclc/opencl/lib/generic/math/asin.cl
index 58e4b7440d6f3..b8d02cef7d3ac 100644
--- a/libclc/generic/lib/math/asin.cl
+++ b/libclc/opencl/lib/generic/math/asin.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_asin.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION asin
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/asinh.cl b/libclc/opencl/lib/generic/math/asinh.cl
similarity index 94%
rename from libclc/generic/lib/math/asinh.cl
rename to libclc/opencl/lib/generic/math/asinh.cl
index 84ba61d052b8f..f043a33fe3177 100644
--- a/libclc/generic/lib/math/asinh.cl
+++ b/libclc/opencl/lib/generic/math/asinh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_asinh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION asinh
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/asinpi.cl b/libclc/opencl/lib/generic/math/asinpi.cl
similarity index 94%
rename from libclc/generic/lib/math/asinpi.cl
rename to libclc/opencl/lib/generic/math/asinpi.cl
index bf232ef89e606..688da90337ea9 100644
--- a/libclc/generic/lib/math/asinpi.cl
+++ b/libclc/opencl/lib/generic/math/asinpi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_asinpi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION asinpi
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/atan.cl b/libclc/opencl/lib/generic/math/atan.cl
similarity index 94%
rename from libclc/generic/lib/math/atan.cl
rename to libclc/opencl/lib/generic/math/atan.cl
index b0a466aee5e14..006fc9e65d45e 100644
--- a/libclc/generic/lib/math/atan.cl
+++ b/libclc/opencl/lib/generic/math/atan.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_atan.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION atan
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/atan2.cl b/libclc/opencl/lib/generic/math/atan2.cl
similarity index 95%
rename from libclc/generic/lib/math/atan2.cl
rename to libclc/opencl/lib/generic/math/atan2.cl
index 20651c1ec1bf3..ae277e7dc9567 100644
--- a/libclc/generic/lib/math/atan2.cl
+++ b/libclc/opencl/lib/generic/math/atan2.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_atan2.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION atan2
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/atan2pi.cl b/libclc/opencl/lib/generic/math/atan2pi.cl
similarity index 95%
rename from libclc/generic/lib/math/atan2pi.cl
rename to libclc/opencl/lib/generic/math/atan2pi.cl
index 316db1d6c9c48..06f0974d4325a 100644
--- a/libclc/generic/lib/math/atan2pi.cl
+++ b/libclc/opencl/lib/generic/math/atan2pi.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_atan2pi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION atan2pi
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/atanh.cl b/libclc/opencl/lib/generic/math/atanh.cl
similarity index 94%
rename from libclc/generic/lib/math/atanh.cl
rename to libclc/opencl/lib/generic/math/atanh.cl
index 5d92cdbd2adf6..ad4c54b81d21d 100644
--- a/libclc/generic/lib/math/atanh.cl
+++ b/libclc/opencl/lib/generic/math/atanh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_atanh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION atanh
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/atanpi.cl b/libclc/opencl/lib/generic/math/atanpi.cl
similarity index 94%
rename from libclc/generic/lib/math/atanpi.cl
rename to libclc/opencl/lib/generic/math/atanpi.cl
index 4337bdf3f660c..3eba081d1b3f9 100644
--- a/libclc/generic/lib/math/atanpi.cl
+++ b/libclc/opencl/lib/generic/math/atanpi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_atanpi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION atanpi
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/cbrt.cl b/libclc/opencl/lib/generic/math/cbrt.cl
similarity index 94%
rename from libclc/generic/lib/math/cbrt.cl
rename to libclc/opencl/lib/generic/math/cbrt.cl
index 4bd5efd4ef7c0..edccc1aaa187d 100644
--- a/libclc/generic/lib/math/cbrt.cl
+++ b/libclc/opencl/lib/generic/math/cbrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_cbrt.inc>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION cbrt
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/ceil.cl b/libclc/opencl/lib/generic/math/ceil.cl
similarity index 94%
rename from libclc/generic/lib/math/ceil.cl
rename to libclc/opencl/lib/generic/math/ceil.cl
index 00635dcb5507a..981fa80a44430 100644
--- a/libclc/generic/lib/math/ceil.cl
+++ b/libclc/opencl/lib/generic/math/ceil.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_ceil.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION ceil
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/copysign.cl b/libclc/opencl/lib/generic/math/copysign.cl
similarity index 94%
rename from libclc/generic/lib/math/copysign.cl
rename to libclc/opencl/lib/generic/math/copysign.cl
index e38aa035d7bf9..9a34aa3ea94f8 100644
--- a/libclc/generic/lib/math/copysign.cl
+++ b/libclc/opencl/lib/generic/math/copysign.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_copysign.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION copysign
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/cos.cl b/libclc/opencl/lib/generic/math/cos.cl
similarity index 94%
rename from libclc/generic/lib/math/cos.cl
rename to libclc/opencl/lib/generic/math/cos.cl
index 5b97c6a6f379a..01f419ebc2878 100644
--- a/libclc/generic/lib/math/cos.cl
+++ b/libclc/opencl/lib/generic/math/cos.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_cos.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION cos
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/cosh.cl b/libclc/opencl/lib/generic/math/cosh.cl
similarity index 94%
rename from libclc/generic/lib/math/cosh.cl
rename to libclc/opencl/lib/generic/math/cosh.cl
index 870c56029f338..c2ee2375ce5a8 100644
--- a/libclc/generic/lib/math/cosh.cl
+++ b/libclc/opencl/lib/generic/math/cosh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_cosh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION cosh
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/cospi.cl b/libclc/opencl/lib/generic/math/cospi.cl
similarity index 94%
rename from libclc/generic/lib/math/cospi.cl
rename to libclc/opencl/lib/generic/math/cospi.cl
index f78935664c65b..05de33f74373c 100644
--- a/libclc/generic/lib/math/cospi.cl
+++ b/libclc/opencl/lib/generic/math/cospi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_cospi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION cospi
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/erf.cl b/libclc/opencl/lib/generic/math/erf.cl
similarity index 94%
rename from libclc/generic/lib/math/erf.cl
rename to libclc/opencl/lib/generic/math/erf.cl
index 78c34fe0188f2..ba60e4c47355f 100644
--- a/libclc/generic/lib/math/erf.cl
+++ b/libclc/opencl/lib/generic/math/erf.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_erf.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION erf
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/erfc.cl b/libclc/opencl/lib/generic/math/erfc.cl
similarity index 94%
rename from libclc/generic/lib/math/erfc.cl
rename to libclc/opencl/lib/generic/math/erfc.cl
index 84d578611012b..4624a04525668 100644
--- a/libclc/generic/lib/math/erfc.cl
+++ b/libclc/opencl/lib/generic/math/erfc.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_erfc.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION erfc
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/exp.cl b/libclc/opencl/lib/generic/math/exp.cl
similarity index 94%
rename from libclc/generic/lib/math/exp.cl
rename to libclc/opencl/lib/generic/math/exp.cl
index cebd630e52ab7..8b20e26716a3a 100644
--- a/libclc/generic/lib/math/exp.cl
+++ b/libclc/opencl/lib/generic/math/exp.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_exp.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION exp
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/exp10.cl b/libclc/opencl/lib/generic/math/exp10.cl
similarity index 94%
rename from libclc/generic/lib/math/exp10.cl
rename to libclc/opencl/lib/generic/math/exp10.cl
index 79544b26fa539..d5bcf1960d7d9 100644
--- a/libclc/generic/lib/math/exp10.cl
+++ b/libclc/opencl/lib/generic/math/exp10.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_exp10.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION exp10
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/exp2.cl b/libclc/opencl/lib/generic/math/exp2.cl
similarity index 94%
rename from libclc/generic/lib/math/exp2.cl
rename to libclc/opencl/lib/generic/math/exp2.cl
index 465c39174a734..130dbbd77be8a 100644
--- a/libclc/generic/lib/math/exp2.cl
+++ b/libclc/opencl/lib/generic/math/exp2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_exp2.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION exp2
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/expm1.cl b/libclc/opencl/lib/generic/math/expm1.cl
similarity index 94%
rename from libclc/generic/lib/math/expm1.cl
rename to libclc/opencl/lib/generic/math/expm1.cl
index b4eed66d692b4..26c3eac9e678b 100644
--- a/libclc/generic/lib/math/expm1.cl
+++ b/libclc/opencl/lib/generic/math/expm1.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_expm1.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION expm1
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/fabs.cl b/libclc/opencl/lib/generic/math/fabs.cl
similarity index 94%
rename from libclc/generic/lib/math/fabs.cl
rename to libclc/opencl/lib/generic/math/fabs.cl
index 2723fae8b05c5..4f9cf117a85f2 100644
--- a/libclc/generic/lib/math/fabs.cl
+++ b/libclc/opencl/lib/generic/math/fabs.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_fabs.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fabs
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/fdim.cl b/libclc/opencl/lib/generic/math/fdim.cl
similarity index 94%
rename from libclc/generic/lib/math/fdim.cl
rename to libclc/opencl/lib/generic/math/fdim.cl
index dc078d42fd591..6b9a46c1bbe1a 100644
--- a/libclc/generic/lib/math/fdim.cl
+++ b/libclc/opencl/lib/generic/math/fdim.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_fdim.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fdim
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/floor.cl b/libclc/opencl/lib/generic/math/floor.cl
similarity index 94%
rename from libclc/generic/lib/math/floor.cl
rename to libclc/opencl/lib/generic/math/floor.cl
index d74a50d3a22ac..9d5f5691a7059 100644
--- a/libclc/generic/lib/math/floor.cl
+++ b/libclc/opencl/lib/generic/math/floor.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_floor.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION floor
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/fma.cl b/libclc/opencl/lib/generic/math/fma.cl
similarity index 96%
rename from libclc/generic/lib/math/fma.cl
rename to libclc/opencl/lib/generic/math/fma.cl
index db162e1e417d8..ee3395bb2c648 100644
--- a/libclc/generic/lib/math/fma.cl
+++ b/libclc/opencl/lib/generic/math/fma.cl
@@ -6,10 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_fma.h>
 #include <clc/math/math.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_TERNARY_BUILTIN(float, fma, __clc_fma, float, float, float)
 

diff  --git a/libclc/generic/lib/math/fmax.cl b/libclc/opencl/lib/generic/math/fmax.cl
similarity index 94%
rename from libclc/generic/lib/math/fmax.cl
rename to libclc/opencl/lib/generic/math/fmax.cl
index 6ad5901eab739..6bc22823757a6 100644
--- a/libclc/generic/lib/math/fmax.cl
+++ b/libclc/opencl/lib/generic/math/fmax.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_fmax.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fmax
 #define __CLC_BODY <clc/shared/binary_def_with_scalar_second_arg.inc>

diff  --git a/libclc/generic/lib/math/fmax.inc b/libclc/opencl/lib/generic/math/fmax.inc
similarity index 100%
rename from libclc/generic/lib/math/fmax.inc
rename to libclc/opencl/lib/generic/math/fmax.inc

diff  --git a/libclc/generic/lib/math/fmin.cl b/libclc/opencl/lib/generic/math/fmin.cl
similarity index 94%
rename from libclc/generic/lib/math/fmin.cl
rename to libclc/opencl/lib/generic/math/fmin.cl
index bb42a2a6d647d..2aea160b975e4 100644
--- a/libclc/generic/lib/math/fmin.cl
+++ b/libclc/opencl/lib/generic/math/fmin.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_fmin.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fmin
 #define __CLC_BODY <clc/shared/binary_def_with_scalar_second_arg.inc>

diff  --git a/libclc/generic/lib/math/fmin.inc b/libclc/opencl/lib/generic/math/fmin.inc
similarity index 100%
rename from libclc/generic/lib/math/fmin.inc
rename to libclc/opencl/lib/generic/math/fmin.inc

diff  --git a/libclc/generic/lib/math/fmod.cl b/libclc/opencl/lib/generic/math/fmod.cl
similarity index 94%
rename from libclc/generic/lib/math/fmod.cl
rename to libclc/opencl/lib/generic/math/fmod.cl
index 07f880486c0f6..ddd071fdab95b 100644
--- a/libclc/generic/lib/math/fmod.cl
+++ b/libclc/opencl/lib/generic/math/fmod.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_fmod.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fmod
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/fract.cl b/libclc/opencl/lib/generic/math/fract.cl
similarity index 94%
rename from libclc/generic/lib/math/fract.cl
rename to libclc/opencl/lib/generic/math/fract.cl
index 54a2cf8411665..c3e8b0afee78d 100644
--- a/libclc/generic/lib/math/fract.cl
+++ b/libclc/opencl/lib/generic/math/fract.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_fract.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION fract
 #define __CLC_BODY <clc/math/unary_def_with_ptr.inc>

diff  --git a/libclc/generic/lib/math/frexp.cl b/libclc/opencl/lib/generic/math/frexp.cl
similarity index 94%
rename from libclc/generic/lib/math/frexp.cl
rename to libclc/opencl/lib/generic/math/frexp.cl
index 355e284524fa4..940a8e37b5b59 100644
--- a/libclc/generic/lib/math/frexp.cl
+++ b/libclc/opencl/lib/generic/math/frexp.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_frexp.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION frexp
 #define __CLC_BODY <clc/math/unary_def_with_int_ptr.inc>

diff  --git a/libclc/generic/lib/math/half_cos.cl b/libclc/opencl/lib/generic/math/half_cos.cl
similarity index 95%
rename from libclc/generic/lib/math/half_cos.cl
rename to libclc/opencl/lib/generic/math/half_cos.cl
index 1e49ebe8ce73a..5bb91b8addbca 100644
--- a/libclc/generic/lib/math/half_cos.cl
+++ b/libclc/opencl/lib/generic/math/half_cos.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_cos.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_cos

diff  --git a/libclc/generic/lib/math/half_divide.cl b/libclc/opencl/lib/generic/math/half_divide.cl
similarity index 95%
rename from libclc/generic/lib/math/half_divide.cl
rename to libclc/opencl/lib/generic/math/half_divide.cl
index 29b5679f428e0..8b5d8eddd67a7 100644
--- a/libclc/generic/lib/math/half_divide.cl
+++ b/libclc/opencl/lib/generic/math/half_divide.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_divide.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_divide

diff  --git a/libclc/generic/lib/math/half_exp.cl b/libclc/opencl/lib/generic/math/half_exp.cl
similarity index 95%
rename from libclc/generic/lib/math/half_exp.cl
rename to libclc/opencl/lib/generic/math/half_exp.cl
index 219b262190104..97507ab2e189a 100644
--- a/libclc/generic/lib/math/half_exp.cl
+++ b/libclc/opencl/lib/generic/math/half_exp.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_exp.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_exp

diff  --git a/libclc/generic/lib/math/half_exp10.cl b/libclc/opencl/lib/generic/math/half_exp10.cl
similarity index 95%
rename from libclc/generic/lib/math/half_exp10.cl
rename to libclc/opencl/lib/generic/math/half_exp10.cl
index 64132c0f93988..6925035d05f7c 100644
--- a/libclc/generic/lib/math/half_exp10.cl
+++ b/libclc/opencl/lib/generic/math/half_exp10.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_exp10.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_exp10

diff  --git a/libclc/generic/lib/math/half_exp2.cl b/libclc/opencl/lib/generic/math/half_exp2.cl
similarity index 95%
rename from libclc/generic/lib/math/half_exp2.cl
rename to libclc/opencl/lib/generic/math/half_exp2.cl
index 9fddc5eb096eb..5bd244482ffa4 100644
--- a/libclc/generic/lib/math/half_exp2.cl
+++ b/libclc/opencl/lib/generic/math/half_exp2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_exp2.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_exp2

diff  --git a/libclc/generic/lib/math/half_log.cl b/libclc/opencl/lib/generic/math/half_log.cl
similarity index 95%
rename from libclc/generic/lib/math/half_log.cl
rename to libclc/opencl/lib/generic/math/half_log.cl
index b3d2c27117763..28c6964166983 100644
--- a/libclc/generic/lib/math/half_log.cl
+++ b/libclc/opencl/lib/generic/math/half_log.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_log.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_log

diff  --git a/libclc/generic/lib/math/half_log10.cl b/libclc/opencl/lib/generic/math/half_log10.cl
similarity index 95%
rename from libclc/generic/lib/math/half_log10.cl
rename to libclc/opencl/lib/generic/math/half_log10.cl
index 8ef6d463b3f97..fcd0a818308c0 100644
--- a/libclc/generic/lib/math/half_log10.cl
+++ b/libclc/opencl/lib/generic/math/half_log10.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_log10.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_log10

diff  --git a/libclc/generic/lib/math/half_log2.cl b/libclc/opencl/lib/generic/math/half_log2.cl
similarity index 95%
rename from libclc/generic/lib/math/half_log2.cl
rename to libclc/opencl/lib/generic/math/half_log2.cl
index a343dbae36d7b..05214e6f5a629 100644
--- a/libclc/generic/lib/math/half_log2.cl
+++ b/libclc/opencl/lib/generic/math/half_log2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_log2.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_log2

diff  --git a/libclc/generic/lib/math/half_powr.cl b/libclc/opencl/lib/generic/math/half_powr.cl
similarity index 95%
rename from libclc/generic/lib/math/half_powr.cl
rename to libclc/opencl/lib/generic/math/half_powr.cl
index 03c4ca7a01775..3562d3e286faf 100644
--- a/libclc/generic/lib/math/half_powr.cl
+++ b/libclc/opencl/lib/generic/math/half_powr.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_powr.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_powr

diff  --git a/libclc/generic/lib/math/half_recip.cl b/libclc/opencl/lib/generic/math/half_recip.cl
similarity index 95%
rename from libclc/generic/lib/math/half_recip.cl
rename to libclc/opencl/lib/generic/math/half_recip.cl
index 70f7625c43f5c..e2650662372c8 100644
--- a/libclc/generic/lib/math/half_recip.cl
+++ b/libclc/opencl/lib/generic/math/half_recip.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_recip.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_recip

diff  --git a/libclc/generic/lib/math/half_rsqrt.cl b/libclc/opencl/lib/generic/math/half_rsqrt.cl
similarity index 95%
rename from libclc/generic/lib/math/half_rsqrt.cl
rename to libclc/opencl/lib/generic/math/half_rsqrt.cl
index 3fc788d80906a..4f287d72d6417 100644
--- a/libclc/generic/lib/math/half_rsqrt.cl
+++ b/libclc/opencl/lib/generic/math/half_rsqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_rsqrt.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_rsqrt

diff  --git a/libclc/generic/lib/math/half_sin.cl b/libclc/opencl/lib/generic/math/half_sin.cl
similarity index 95%
rename from libclc/generic/lib/math/half_sin.cl
rename to libclc/opencl/lib/generic/math/half_sin.cl
index 6fab611610fb0..c1e5696185102 100644
--- a/libclc/generic/lib/math/half_sin.cl
+++ b/libclc/opencl/lib/generic/math/half_sin.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_sin.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_sin

diff  --git a/libclc/generic/lib/math/half_sqrt.cl b/libclc/opencl/lib/generic/math/half_sqrt.cl
similarity index 95%
rename from libclc/generic/lib/math/half_sqrt.cl
rename to libclc/opencl/lib/generic/math/half_sqrt.cl
index e96e127a89b3e..c327881a553b8 100644
--- a/libclc/generic/lib/math/half_sqrt.cl
+++ b/libclc/opencl/lib/generic/math/half_sqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_sqrt.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_sqrt

diff  --git a/libclc/generic/lib/math/half_tan.cl b/libclc/opencl/lib/generic/math/half_tan.cl
similarity index 95%
rename from libclc/generic/lib/math/half_tan.cl
rename to libclc/opencl/lib/generic/math/half_tan.cl
index ddfcfae4ff994..0d16b08dc2233 100644
--- a/libclc/generic/lib/math/half_tan.cl
+++ b/libclc/opencl/lib/generic/math/half_tan.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_half_tan.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION half_tan

diff  --git a/libclc/generic/lib/math/hypot.cl b/libclc/opencl/lib/generic/math/hypot.cl
similarity index 94%
rename from libclc/generic/lib/math/hypot.cl
rename to libclc/opencl/lib/generic/math/hypot.cl
index ff95bd20f6d48..3ac2983efc4bf 100644
--- a/libclc/generic/lib/math/hypot.cl
+++ b/libclc/opencl/lib/generic/math/hypot.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_hypot.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION hypot
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/ilogb.cl b/libclc/opencl/lib/generic/math/ilogb.cl
similarity index 94%
rename from libclc/generic/lib/math/ilogb.cl
rename to libclc/opencl/lib/generic/math/ilogb.cl
index 9e3795a524b23..147f82d95d1f0 100644
--- a/libclc/generic/lib/math/ilogb.cl
+++ b/libclc/opencl/lib/generic/math/ilogb.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_ilogb.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION ilogb
 #define __CLC_BODY <clc/math/unary_def_with_int_return.inc>

diff  --git a/libclc/generic/lib/math/ldexp.cl b/libclc/opencl/lib/generic/math/ldexp.cl
similarity index 97%
rename from libclc/generic/lib/math/ldexp.cl
rename to libclc/opencl/lib/generic/math/ldexp.cl
index 4dbb58fe3d5bc..e3b9b2b3f1363 100644
--- a/libclc/generic/lib/math/ldexp.cl
+++ b/libclc/opencl/lib/generic/math/ldexp.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_ldexp.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_BINARY_BUILTIN_NO_SCALARIZE(float, ldexp, __clc_ldexp, float, int)
 

diff  --git a/libclc/generic/lib/math/ldexp.inc b/libclc/opencl/lib/generic/math/ldexp.inc
similarity index 100%
rename from libclc/generic/lib/math/ldexp.inc
rename to libclc/opencl/lib/generic/math/ldexp.inc

diff  --git a/libclc/generic/lib/math/lgamma.cl b/libclc/opencl/lib/generic/math/lgamma.cl
similarity index 94%
rename from libclc/generic/lib/math/lgamma.cl
rename to libclc/opencl/lib/generic/math/lgamma.cl
index e9cc76e2220e4..002a08153a3a3 100644
--- a/libclc/generic/lib/math/lgamma.cl
+++ b/libclc/opencl/lib/generic/math/lgamma.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_lgamma.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION lgamma
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/lgamma_r.cl b/libclc/opencl/lib/generic/math/lgamma_r.cl
similarity index 94%
rename from libclc/generic/lib/math/lgamma_r.cl
rename to libclc/opencl/lib/generic/math/lgamma_r.cl
index 66fdb741ca659..c44051cb4c39a 100644
--- a/libclc/generic/lib/math/lgamma_r.cl
+++ b/libclc/opencl/lib/generic/math/lgamma_r.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_lgamma_r.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION lgamma_r
 #define __CLC_BODY <clc/math/unary_def_with_int_ptr.inc>

diff  --git a/libclc/generic/lib/math/log.cl b/libclc/opencl/lib/generic/math/log.cl
similarity index 94%
rename from libclc/generic/lib/math/log.cl
rename to libclc/opencl/lib/generic/math/log.cl
index 43d3fdc8d20cc..78430644a55ee 100644
--- a/libclc/generic/lib/math/log.cl
+++ b/libclc/opencl/lib/generic/math/log.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_log.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION log
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/log10.cl b/libclc/opencl/lib/generic/math/log10.cl
similarity index 94%
rename from libclc/generic/lib/math/log10.cl
rename to libclc/opencl/lib/generic/math/log10.cl
index db405d4929d24..01113e7c00c92 100644
--- a/libclc/generic/lib/math/log10.cl
+++ b/libclc/opencl/lib/generic/math/log10.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_log10.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION log10
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/log1p.cl b/libclc/opencl/lib/generic/math/log1p.cl
similarity index 94%
rename from libclc/generic/lib/math/log1p.cl
rename to libclc/opencl/lib/generic/math/log1p.cl
index 47245d1178a58..26c4df015bc88 100644
--- a/libclc/generic/lib/math/log1p.cl
+++ b/libclc/opencl/lib/generic/math/log1p.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_log1p.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION log1p
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/log2.cl b/libclc/opencl/lib/generic/math/log2.cl
similarity index 94%
rename from libclc/generic/lib/math/log2.cl
rename to libclc/opencl/lib/generic/math/log2.cl
index 6e54f433f3591..d70f16d6f7d89 100644
--- a/libclc/generic/lib/math/log2.cl
+++ b/libclc/opencl/lib/generic/math/log2.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_log2.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION log2
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/logb.cl b/libclc/opencl/lib/generic/math/logb.cl
similarity index 94%
rename from libclc/generic/lib/math/logb.cl
rename to libclc/opencl/lib/generic/math/logb.cl
index 25e676ef98fbd..21046f2ac98cf 100644
--- a/libclc/generic/lib/math/logb.cl
+++ b/libclc/opencl/lib/generic/math/logb.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_logb.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION logb
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/mad.cl b/libclc/opencl/lib/generic/math/mad.cl
similarity index 96%
rename from libclc/generic/lib/math/mad.cl
rename to libclc/opencl/lib/generic/math/mad.cl
index 611dca19f1d8c..20e6903094454 100644
--- a/libclc/generic/lib/math/mad.cl
+++ b/libclc/opencl/lib/generic/math/mad.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_mad.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_TERNARY_BUILTIN(float, mad, __clc_mad, float, float, float)
 

diff  --git a/libclc/generic/lib/math/maxmag.cl b/libclc/opencl/lib/generic/math/maxmag.cl
similarity index 94%
rename from libclc/generic/lib/math/maxmag.cl
rename to libclc/opencl/lib/generic/math/maxmag.cl
index 720fc027177ac..cf4cfc7ded3a5 100644
--- a/libclc/generic/lib/math/maxmag.cl
+++ b/libclc/opencl/lib/generic/math/maxmag.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_maxmag.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION maxmag
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/minmag.cl b/libclc/opencl/lib/generic/math/minmag.cl
similarity index 94%
rename from libclc/generic/lib/math/minmag.cl
rename to libclc/opencl/lib/generic/math/minmag.cl
index 37536584f8f85..e636ca7e2c40a 100644
--- a/libclc/generic/lib/math/minmag.cl
+++ b/libclc/opencl/lib/generic/math/minmag.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_minmag.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION minmag
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/modf.cl b/libclc/opencl/lib/generic/math/modf.cl
similarity index 94%
rename from libclc/generic/lib/math/modf.cl
rename to libclc/opencl/lib/generic/math/modf.cl
index cf4eaa8012b52..7ad3a2c7550d9 100644
--- a/libclc/generic/lib/math/modf.cl
+++ b/libclc/opencl/lib/generic/math/modf.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_modf.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION modf
 #define __CLC_BODY <clc/math/unary_def_with_ptr.inc>

diff  --git a/libclc/generic/lib/math/nan.cl b/libclc/opencl/lib/generic/math/nan.cl
similarity index 100%
rename from libclc/generic/lib/math/nan.cl
rename to libclc/opencl/lib/generic/math/nan.cl

diff  --git a/libclc/generic/lib/math/nan.inc b/libclc/opencl/lib/generic/math/nan.inc
similarity index 100%
rename from libclc/generic/lib/math/nan.inc
rename to libclc/opencl/lib/generic/math/nan.inc

diff  --git a/libclc/generic/lib/math/native_cos.cl b/libclc/opencl/lib/generic/math/native_cos.cl
similarity index 95%
rename from libclc/generic/lib/math/native_cos.cl
rename to libclc/opencl/lib/generic/math/native_cos.cl
index 0f4d46c1d73e4..d0df037716943 100644
--- a/libclc/generic/lib/math/native_cos.cl
+++ b/libclc/opencl/lib/generic/math/native_cos.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_cos.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_cos

diff  --git a/libclc/generic/lib/math/native_divide.cl b/libclc/opencl/lib/generic/math/native_divide.cl
similarity index 95%
rename from libclc/generic/lib/math/native_divide.cl
rename to libclc/opencl/lib/generic/math/native_divide.cl
index a4d9b830b5519..6bcc5ecf4d05b 100644
--- a/libclc/generic/lib/math/native_divide.cl
+++ b/libclc/opencl/lib/generic/math/native_divide.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_divide.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_divide

diff  --git a/libclc/generic/lib/math/native_exp.cl b/libclc/opencl/lib/generic/math/native_exp.cl
similarity index 95%
rename from libclc/generic/lib/math/native_exp.cl
rename to libclc/opencl/lib/generic/math/native_exp.cl
index c1d08ec2c7e1f..23b72fc82f8c0 100644
--- a/libclc/generic/lib/math/native_exp.cl
+++ b/libclc/opencl/lib/generic/math/native_exp.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_exp.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_exp

diff  --git a/libclc/generic/lib/math/native_exp10.cl b/libclc/opencl/lib/generic/math/native_exp10.cl
similarity index 95%
rename from libclc/generic/lib/math/native_exp10.cl
rename to libclc/opencl/lib/generic/math/native_exp10.cl
index a7f3711cbedfd..76cbc57cb3ba5 100644
--- a/libclc/generic/lib/math/native_exp10.cl
+++ b/libclc/opencl/lib/generic/math/native_exp10.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_exp10.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_exp10

diff  --git a/libclc/generic/lib/math/native_exp2.cl b/libclc/opencl/lib/generic/math/native_exp2.cl
similarity index 95%
rename from libclc/generic/lib/math/native_exp2.cl
rename to libclc/opencl/lib/generic/math/native_exp2.cl
index ceb570733b974..107db022b6e2b 100644
--- a/libclc/generic/lib/math/native_exp2.cl
+++ b/libclc/opencl/lib/generic/math/native_exp2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_exp2.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_exp2

diff  --git a/libclc/generic/lib/math/native_log.cl b/libclc/opencl/lib/generic/math/native_log.cl
similarity index 95%
rename from libclc/generic/lib/math/native_log.cl
rename to libclc/opencl/lib/generic/math/native_log.cl
index adc2ff495f8b5..3faf70674fac8 100644
--- a/libclc/generic/lib/math/native_log.cl
+++ b/libclc/opencl/lib/generic/math/native_log.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_log.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_log

diff  --git a/libclc/generic/lib/math/native_log10.cl b/libclc/opencl/lib/generic/math/native_log10.cl
similarity index 95%
rename from libclc/generic/lib/math/native_log10.cl
rename to libclc/opencl/lib/generic/math/native_log10.cl
index f63292124f3b7..e71ac4448df25 100644
--- a/libclc/generic/lib/math/native_log10.cl
+++ b/libclc/opencl/lib/generic/math/native_log10.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_log10.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_log10

diff  --git a/libclc/generic/lib/math/native_log2.cl b/libclc/opencl/lib/generic/math/native_log2.cl
similarity index 95%
rename from libclc/generic/lib/math/native_log2.cl
rename to libclc/opencl/lib/generic/math/native_log2.cl
index 6b079872b1e0a..c971013c4021d 100644
--- a/libclc/generic/lib/math/native_log2.cl
+++ b/libclc/opencl/lib/generic/math/native_log2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_log2.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_log2

diff  --git a/libclc/generic/lib/math/native_powr.cl b/libclc/opencl/lib/generic/math/native_powr.cl
similarity index 95%
rename from libclc/generic/lib/math/native_powr.cl
rename to libclc/opencl/lib/generic/math/native_powr.cl
index 31a650b79b609..ffc7e5a174377 100644
--- a/libclc/generic/lib/math/native_powr.cl
+++ b/libclc/opencl/lib/generic/math/native_powr.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_powr.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_powr

diff  --git a/libclc/generic/lib/math/native_recip.cl b/libclc/opencl/lib/generic/math/native_recip.cl
similarity index 95%
rename from libclc/generic/lib/math/native_recip.cl
rename to libclc/opencl/lib/generic/math/native_recip.cl
index 3c844495046f1..cad339ecb4f78 100644
--- a/libclc/generic/lib/math/native_recip.cl
+++ b/libclc/opencl/lib/generic/math/native_recip.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_recip.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_recip

diff  --git a/libclc/generic/lib/math/native_rsqrt.cl b/libclc/opencl/lib/generic/math/native_rsqrt.cl
similarity index 95%
rename from libclc/generic/lib/math/native_rsqrt.cl
rename to libclc/opencl/lib/generic/math/native_rsqrt.cl
index cb49b2d1d6706..69a387387f336 100644
--- a/libclc/generic/lib/math/native_rsqrt.cl
+++ b/libclc/opencl/lib/generic/math/native_rsqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_rsqrt.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_rsqrt

diff  --git a/libclc/generic/lib/math/native_sin.cl b/libclc/opencl/lib/generic/math/native_sin.cl
similarity index 95%
rename from libclc/generic/lib/math/native_sin.cl
rename to libclc/opencl/lib/generic/math/native_sin.cl
index 50265b3936272..c1a3faed39a26 100644
--- a/libclc/generic/lib/math/native_sin.cl
+++ b/libclc/opencl/lib/generic/math/native_sin.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_sin.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_sin

diff  --git a/libclc/generic/lib/math/native_sqrt.cl b/libclc/opencl/lib/generic/math/native_sqrt.cl
similarity index 95%
rename from libclc/generic/lib/math/native_sqrt.cl
rename to libclc/opencl/lib/generic/math/native_sqrt.cl
index 4cd022e8bbeba..5b5487cfea934 100644
--- a/libclc/generic/lib/math/native_sqrt.cl
+++ b/libclc/opencl/lib/generic/math/native_sqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_sqrt.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_sqrt

diff  --git a/libclc/generic/lib/math/native_tan.cl b/libclc/opencl/lib/generic/math/native_tan.cl
similarity index 95%
rename from libclc/generic/lib/math/native_tan.cl
rename to libclc/opencl/lib/generic/math/native_tan.cl
index 2b474ed46a5b5..000d6c5f366a1 100644
--- a/libclc/generic/lib/math/native_tan.cl
+++ b/libclc/opencl/lib/generic/math/native_tan.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_native_tan.h>
+#include <clc/opencl/clc.h>
 
 #define __FLOAT_ONLY
 #define FUNCTION native_tan

diff  --git a/libclc/generic/lib/math/nextafter.cl b/libclc/opencl/lib/generic/math/nextafter.cl
similarity index 97%
rename from libclc/generic/lib/math/nextafter.cl
rename to libclc/opencl/lib/generic/math/nextafter.cl
index 3dbe224924780..ecb187c53069e 100644
--- a/libclc/generic/lib/math/nextafter.cl
+++ b/libclc/opencl/lib/generic/math/nextafter.cl
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/math/clc_nextafter.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_BINARY_BUILTIN_NO_SCALARIZE(float, nextafter, __clc_nextafter,
                                         float, float)

diff  --git a/libclc/generic/lib/math/pow.cl b/libclc/opencl/lib/generic/math/pow.cl
similarity index 94%
rename from libclc/generic/lib/math/pow.cl
rename to libclc/opencl/lib/generic/math/pow.cl
index a997d32e16f5e..b3a77f5a2a71e 100644
--- a/libclc/generic/lib/math/pow.cl
+++ b/libclc/opencl/lib/generic/math/pow.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_pow.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION pow
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/pown.cl b/libclc/opencl/lib/generic/math/pown.cl
similarity index 94%
rename from libclc/generic/lib/math/pown.cl
rename to libclc/opencl/lib/generic/math/pown.cl
index 8c077f7aae148..a2ed523a41f74 100644
--- a/libclc/generic/lib/math/pown.cl
+++ b/libclc/opencl/lib/generic/math/pown.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_pown.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION pown
 #define __CLC_BODY <clc/math/binary_def_with_int_second_arg.inc>

diff  --git a/libclc/generic/lib/math/powr.cl b/libclc/opencl/lib/generic/math/powr.cl
similarity index 94%
rename from libclc/generic/lib/math/powr.cl
rename to libclc/opencl/lib/generic/math/powr.cl
index 8b3df54a2434a..87707198aae15 100644
--- a/libclc/generic/lib/math/powr.cl
+++ b/libclc/opencl/lib/generic/math/powr.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_powr.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION powr
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/remainder.cl b/libclc/opencl/lib/generic/math/remainder.cl
similarity index 94%
rename from libclc/generic/lib/math/remainder.cl
rename to libclc/opencl/lib/generic/math/remainder.cl
index b5f96c2cd6036..aeba5d59e89a9 100644
--- a/libclc/generic/lib/math/remainder.cl
+++ b/libclc/opencl/lib/generic/math/remainder.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_remainder.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION remainder
 #define __CLC_BODY <clc/shared/binary_def.inc>

diff  --git a/libclc/generic/lib/math/remquo.cl b/libclc/opencl/lib/generic/math/remquo.cl
similarity index 96%
rename from libclc/generic/lib/math/remquo.cl
rename to libclc/opencl/lib/generic/math/remquo.cl
index d0c4b16ed7c39..94e7664edb4fe 100644
--- a/libclc/generic/lib/math/remquo.cl
+++ b/libclc/opencl/lib/generic/math/remquo.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_remquo.h>
+#include <clc/opencl/clc.h>
 
 #define __CLC_BODY <remquo.inc>
 #define __CLC_ADDRESS_SPACE global

diff  --git a/libclc/generic/lib/math/remquo.inc b/libclc/opencl/lib/generic/math/remquo.inc
similarity index 100%
rename from libclc/generic/lib/math/remquo.inc
rename to libclc/opencl/lib/generic/math/remquo.inc

diff  --git a/libclc/generic/lib/math/rint.cl b/libclc/opencl/lib/generic/math/rint.cl
similarity index 94%
rename from libclc/generic/lib/math/rint.cl
rename to libclc/opencl/lib/generic/math/rint.cl
index b84438067a9c7..84ce99c4d216c 100644
--- a/libclc/generic/lib/math/rint.cl
+++ b/libclc/opencl/lib/generic/math/rint.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_rint.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION rint
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/rootn.cl b/libclc/opencl/lib/generic/math/rootn.cl
similarity index 94%
rename from libclc/generic/lib/math/rootn.cl
rename to libclc/opencl/lib/generic/math/rootn.cl
index b14248636e149..9f737151b3903 100644
--- a/libclc/generic/lib/math/rootn.cl
+++ b/libclc/opencl/lib/generic/math/rootn.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_rootn.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION rootn
 #define __CLC_BODY <clc/math/binary_def_with_int_second_arg.inc>

diff  --git a/libclc/generic/lib/math/round.cl b/libclc/opencl/lib/generic/math/round.cl
similarity index 94%
rename from libclc/generic/lib/math/round.cl
rename to libclc/opencl/lib/generic/math/round.cl
index bf1ced1e8abc9..0ce44e72b00aa 100644
--- a/libclc/generic/lib/math/round.cl
+++ b/libclc/opencl/lib/generic/math/round.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_round.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION round
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/rsqrt.cl b/libclc/opencl/lib/generic/math/rsqrt.cl
similarity index 94%
rename from libclc/generic/lib/math/rsqrt.cl
rename to libclc/opencl/lib/generic/math/rsqrt.cl
index b2ba9ad6fc0b9..7d6dcfaa3de7d 100644
--- a/libclc/generic/lib/math/rsqrt.cl
+++ b/libclc/opencl/lib/generic/math/rsqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_rsqrt.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION rsqrt
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/sin.cl b/libclc/opencl/lib/generic/math/sin.cl
similarity index 94%
rename from libclc/generic/lib/math/sin.cl
rename to libclc/opencl/lib/generic/math/sin.cl
index 76728cfb1c5e5..293a2636c3070 100644
--- a/libclc/generic/lib/math/sin.cl
+++ b/libclc/opencl/lib/generic/math/sin.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_sin.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sin
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/sincos.cl b/libclc/opencl/lib/generic/math/sincos.cl
similarity index 94%
rename from libclc/generic/lib/math/sincos.cl
rename to libclc/opencl/lib/generic/math/sincos.cl
index 25e620cf2a38e..d87da4d7df912 100644
--- a/libclc/generic/lib/math/sincos.cl
+++ b/libclc/opencl/lib/generic/math/sincos.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_sincos.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sincos
 #define __CLC_BODY <clc/math/unary_def_with_ptr.inc>

diff  --git a/libclc/generic/lib/math/sinh.cl b/libclc/opencl/lib/generic/math/sinh.cl
similarity index 94%
rename from libclc/generic/lib/math/sinh.cl
rename to libclc/opencl/lib/generic/math/sinh.cl
index 305f9bf647ff7..aa559f9330889 100644
--- a/libclc/generic/lib/math/sinh.cl
+++ b/libclc/opencl/lib/generic/math/sinh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_sinh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sinh
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/sinpi.cl b/libclc/opencl/lib/generic/math/sinpi.cl
similarity index 94%
rename from libclc/generic/lib/math/sinpi.cl
rename to libclc/opencl/lib/generic/math/sinpi.cl
index 223e7db142117..8b48426a0ef84 100644
--- a/libclc/generic/lib/math/sinpi.cl
+++ b/libclc/opencl/lib/generic/math/sinpi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_sinpi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sinpi
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/sqrt.cl b/libclc/opencl/lib/generic/math/sqrt.cl
similarity index 94%
rename from libclc/generic/lib/math/sqrt.cl
rename to libclc/opencl/lib/generic/math/sqrt.cl
index 7e46186025481..fd031daf5bfbd 100644
--- a/libclc/generic/lib/math/sqrt.cl
+++ b/libclc/opencl/lib/generic/math/sqrt.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_sqrt.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION sqrt
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/tan.cl b/libclc/opencl/lib/generic/math/tan.cl
similarity index 94%
rename from libclc/generic/lib/math/tan.cl
rename to libclc/opencl/lib/generic/math/tan.cl
index 883e331395616..6df22b9c36959 100644
--- a/libclc/generic/lib/math/tan.cl
+++ b/libclc/opencl/lib/generic/math/tan.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_tan.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION tan
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/tanh.cl b/libclc/opencl/lib/generic/math/tanh.cl
similarity index 94%
rename from libclc/generic/lib/math/tanh.cl
rename to libclc/opencl/lib/generic/math/tanh.cl
index f576910f16deb..ef7cb1ec5d861 100644
--- a/libclc/generic/lib/math/tanh.cl
+++ b/libclc/opencl/lib/generic/math/tanh.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_tanh.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION tanh
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/tanpi.cl b/libclc/opencl/lib/generic/math/tanpi.cl
similarity index 94%
rename from libclc/generic/lib/math/tanpi.cl
rename to libclc/opencl/lib/generic/math/tanpi.cl
index 8015d32adb38d..2195830faf32d 100644
--- a/libclc/generic/lib/math/tanpi.cl
+++ b/libclc/opencl/lib/generic/math/tanpi.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_tanpi.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION tanpi
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/tgamma.cl b/libclc/opencl/lib/generic/math/tgamma.cl
similarity index 94%
rename from libclc/generic/lib/math/tgamma.cl
rename to libclc/opencl/lib/generic/math/tgamma.cl
index e400883d55d75..634ed7a506118 100644
--- a/libclc/generic/lib/math/tgamma.cl
+++ b/libclc/opencl/lib/generic/math/tgamma.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_tgamma.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION tgamma
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/math/trunc.cl b/libclc/opencl/lib/generic/math/trunc.cl
similarity index 94%
rename from libclc/generic/lib/math/trunc.cl
rename to libclc/opencl/lib/generic/math/trunc.cl
index d668f39f23341..58f414dcc784c 100644
--- a/libclc/generic/lib/math/trunc.cl
+++ b/libclc/opencl/lib/generic/math/trunc.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_trunc.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION trunc
 #define __CLC_BODY <clc/shared/unary_def.inc>

diff  --git a/libclc/generic/lib/misc/shuffle.cl b/libclc/opencl/lib/generic/misc/shuffle.cl
similarity index 95%
rename from libclc/generic/lib/misc/shuffle.cl
rename to libclc/opencl/lib/generic/misc/shuffle.cl
index 44bcb36bde0e2..f8c5d16d21946 100644
--- a/libclc/generic/lib/misc/shuffle.cl
+++ b/libclc/opencl/lib/generic/misc/shuffle.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/misc/clc_shuffle.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION shuffle
 

diff  --git a/libclc/generic/lib/misc/shuffle2.cl b/libclc/opencl/lib/generic/misc/shuffle2.cl
similarity index 95%
rename from libclc/generic/lib/misc/shuffle2.cl
rename to libclc/opencl/lib/generic/misc/shuffle2.cl
index 718f5580b7323..74487d07db3d9 100644
--- a/libclc/generic/lib/misc/shuffle2.cl
+++ b/libclc/opencl/lib/generic/misc/shuffle2.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/misc/clc_shuffle2.h>
+#include <clc/opencl/clc.h>
 
 #define FUNCTION shuffle2
 

diff  --git a/libclc/generic/lib/relational/all.cl b/libclc/opencl/lib/generic/relational/all.cl
similarity index 97%
rename from libclc/generic/lib/relational/all.cl
rename to libclc/opencl/lib/generic/relational/all.cl
index f5fd9af54966e..43a3236bafe65 100644
--- a/libclc/generic/lib/relational/all.cl
+++ b/libclc/opencl/lib/generic/relational/all.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_all.h>
 
 #define ALL_ID(TYPE) _CLC_OVERLOAD _CLC_DEF int all(TYPE v)

diff  --git a/libclc/generic/lib/relational/any.cl b/libclc/opencl/lib/generic/relational/any.cl
similarity index 97%
rename from libclc/generic/lib/relational/any.cl
rename to libclc/opencl/lib/generic/relational/any.cl
index c661b90cebc51..ae78c623f53f1 100644
--- a/libclc/generic/lib/relational/any.cl
+++ b/libclc/opencl/lib/generic/relational/any.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_any.h>
 
 #define ANY_ID(TYPE) _CLC_OVERLOAD _CLC_DEF int any(TYPE v)

diff  --git a/libclc/generic/lib/relational/binary_def.inc b/libclc/opencl/lib/generic/relational/binary_def.inc
similarity index 100%
rename from libclc/generic/lib/relational/binary_def.inc
rename to libclc/opencl/lib/generic/relational/binary_def.inc

diff  --git a/libclc/generic/lib/relational/bitselect.cl b/libclc/opencl/lib/generic/relational/bitselect.cl
similarity index 95%
rename from libclc/generic/lib/relational/bitselect.cl
rename to libclc/opencl/lib/generic/relational/bitselect.cl
index 2dd1191cfd655..fc0a15768c5f5 100644
--- a/libclc/generic/lib/relational/bitselect.cl
+++ b/libclc/opencl/lib/generic/relational/bitselect.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_bitselect.h>
 
 #define __CLC_BODY <bitselect.inc>

diff  --git a/libclc/generic/lib/relational/bitselect.inc b/libclc/opencl/lib/generic/relational/bitselect.inc
similarity index 100%
rename from libclc/generic/lib/relational/bitselect.inc
rename to libclc/opencl/lib/generic/relational/bitselect.inc

diff  --git a/libclc/generic/lib/relational/isequal.cl b/libclc/opencl/lib/generic/relational/isequal.cl
similarity index 94%
rename from libclc/generic/lib/relational/isequal.cl
rename to libclc/opencl/lib/generic/relational/isequal.cl
index 31f06adee00da..71109d0e0bf3e 100644
--- a/libclc/generic/lib/relational/isequal.cl
+++ b/libclc/opencl/lib/generic/relational/isequal.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isequal.h>
 
 #define FUNCTION isequal

diff  --git a/libclc/generic/lib/relational/isfinite.cl b/libclc/opencl/lib/generic/relational/isfinite.cl
similarity index 94%
rename from libclc/generic/lib/relational/isfinite.cl
rename to libclc/opencl/lib/generic/relational/isfinite.cl
index 180bf9990173d..7ee3ff2262f54 100644
--- a/libclc/generic/lib/relational/isfinite.cl
+++ b/libclc/opencl/lib/generic/relational/isfinite.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isfinite.h>
 
 #define FUNCTION isfinite

diff  --git a/libclc/generic/lib/relational/isgreater.cl b/libclc/opencl/lib/generic/relational/isgreater.cl
similarity index 94%
rename from libclc/generic/lib/relational/isgreater.cl
rename to libclc/opencl/lib/generic/relational/isgreater.cl
index 012ad7a5cdb3f..13ecfa70fa4f6 100644
--- a/libclc/generic/lib/relational/isgreater.cl
+++ b/libclc/opencl/lib/generic/relational/isgreater.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isgreater.h>
 
 #define FUNCTION isgreater

diff  --git a/libclc/generic/lib/relational/isgreaterequal.cl b/libclc/opencl/lib/generic/relational/isgreaterequal.cl
similarity index 94%
rename from libclc/generic/lib/relational/isgreaterequal.cl
rename to libclc/opencl/lib/generic/relational/isgreaterequal.cl
index 24fca170a1671..458c4a6f6b747 100644
--- a/libclc/generic/lib/relational/isgreaterequal.cl
+++ b/libclc/opencl/lib/generic/relational/isgreaterequal.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isgreaterequal.h>
 
 #define FUNCTION isgreaterequal

diff  --git a/libclc/generic/lib/relational/isinf.cl b/libclc/opencl/lib/generic/relational/isinf.cl
similarity index 94%
rename from libclc/generic/lib/relational/isinf.cl
rename to libclc/opencl/lib/generic/relational/isinf.cl
index e295d14215478..65e987940ff50 100644
--- a/libclc/generic/lib/relational/isinf.cl
+++ b/libclc/opencl/lib/generic/relational/isinf.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isinf.h>
 
 #define FUNCTION isinf

diff  --git a/libclc/generic/lib/relational/isless.cl b/libclc/opencl/lib/generic/relational/isless.cl
similarity index 94%
rename from libclc/generic/lib/relational/isless.cl
rename to libclc/opencl/lib/generic/relational/isless.cl
index 3b295c11e1c4a..e1b931aede695 100644
--- a/libclc/generic/lib/relational/isless.cl
+++ b/libclc/opencl/lib/generic/relational/isless.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isless.h>
 
 #define FUNCTION isless

diff  --git a/libclc/generic/lib/relational/islessequal.cl b/libclc/opencl/lib/generic/relational/islessequal.cl
similarity index 94%
rename from libclc/generic/lib/relational/islessequal.cl
rename to libclc/opencl/lib/generic/relational/islessequal.cl
index 270165fe5e173..91d0891e21223 100644
--- a/libclc/generic/lib/relational/islessequal.cl
+++ b/libclc/opencl/lib/generic/relational/islessequal.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_islessequal.h>
 
 #define FUNCTION islessequal

diff  --git a/libclc/generic/lib/relational/islessgreater.cl b/libclc/opencl/lib/generic/relational/islessgreater.cl
similarity index 94%
rename from libclc/generic/lib/relational/islessgreater.cl
rename to libclc/opencl/lib/generic/relational/islessgreater.cl
index 2755aa5a74603..dc519cc602752 100644
--- a/libclc/generic/lib/relational/islessgreater.cl
+++ b/libclc/opencl/lib/generic/relational/islessgreater.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_islessgreater.h>
 
 #define FUNCTION islessgreater

diff  --git a/libclc/generic/lib/relational/isnan.cl b/libclc/opencl/lib/generic/relational/isnan.cl
similarity index 94%
rename from libclc/generic/lib/relational/isnan.cl
rename to libclc/opencl/lib/generic/relational/isnan.cl
index 1a78c909bec77..6761851caffe4 100644
--- a/libclc/generic/lib/relational/isnan.cl
+++ b/libclc/opencl/lib/generic/relational/isnan.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isnan.h>
 
 #define FUNCTION isnan

diff  --git a/libclc/generic/lib/relational/isnormal.cl b/libclc/opencl/lib/generic/relational/isnormal.cl
similarity index 94%
rename from libclc/generic/lib/relational/isnormal.cl
rename to libclc/opencl/lib/generic/relational/isnormal.cl
index 84a031b6bc562..42f3e1f4f4349 100644
--- a/libclc/generic/lib/relational/isnormal.cl
+++ b/libclc/opencl/lib/generic/relational/isnormal.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isnormal.h>
 
 #define FUNCTION isnormal

diff  --git a/libclc/generic/lib/relational/isnotequal.cl b/libclc/opencl/lib/generic/relational/isnotequal.cl
similarity index 94%
rename from libclc/generic/lib/relational/isnotequal.cl
rename to libclc/opencl/lib/generic/relational/isnotequal.cl
index e5c168aca832f..f28317b8fe0f5 100644
--- a/libclc/generic/lib/relational/isnotequal.cl
+++ b/libclc/opencl/lib/generic/relational/isnotequal.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isnotequal.h>
 
 #define FUNCTION isnotequal

diff  --git a/libclc/generic/lib/relational/isordered.cl b/libclc/opencl/lib/generic/relational/isordered.cl
similarity index 94%
rename from libclc/generic/lib/relational/isordered.cl
rename to libclc/opencl/lib/generic/relational/isordered.cl
index 563cf3d4780aa..83117765d5261 100644
--- a/libclc/generic/lib/relational/isordered.cl
+++ b/libclc/opencl/lib/generic/relational/isordered.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isordered.h>
 
 #define FUNCTION isordered

diff  --git a/libclc/generic/lib/relational/isunordered.cl b/libclc/opencl/lib/generic/relational/isunordered.cl
similarity index 94%
rename from libclc/generic/lib/relational/isunordered.cl
rename to libclc/opencl/lib/generic/relational/isunordered.cl
index fb707bb74e5ff..26deb195a7406 100644
--- a/libclc/generic/lib/relational/isunordered.cl
+++ b/libclc/opencl/lib/generic/relational/isunordered.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_isunordered.h>
 
 #define FUNCTION isunordered

diff  --git a/libclc/generic/lib/relational/select.cl b/libclc/opencl/lib/generic/relational/select.cl
similarity index 96%
rename from libclc/generic/lib/relational/select.cl
rename to libclc/opencl/lib/generic/relational/select.cl
index a39aaf4bce40d..c29109b1d3c2c 100644
--- a/libclc/generic/lib/relational/select.cl
+++ b/libclc/opencl/lib/generic/relational/select.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_select.h>
 #include <clc/utils.h>
 

diff  --git a/libclc/generic/lib/relational/signbit.cl b/libclc/opencl/lib/generic/relational/signbit.cl
similarity index 94%
rename from libclc/generic/lib/relational/signbit.cl
rename to libclc/opencl/lib/generic/relational/signbit.cl
index 4828c2596bad6..2b58922bf8705 100644
--- a/libclc/generic/lib/relational/signbit.cl
+++ b/libclc/opencl/lib/generic/relational/signbit.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/relational/clc_signbit.h>
 
 #define FUNCTION signbit

diff  --git a/libclc/generic/lib/relational/unary_def.inc b/libclc/opencl/lib/generic/relational/unary_def.inc
similarity index 100%
rename from libclc/generic/lib/relational/unary_def.inc
rename to libclc/opencl/lib/generic/relational/unary_def.inc

diff  --git a/libclc/generic/lib/shared/clamp.cl b/libclc/opencl/lib/generic/shared/clamp.cl
similarity index 95%
rename from libclc/generic/lib/shared/clamp.cl
rename to libclc/opencl/lib/generic/shared/clamp.cl
index caaa0acb06568..4d00f6f8c3a68 100644
--- a/libclc/generic/lib/shared/clamp.cl
+++ b/libclc/opencl/lib/generic/shared/clamp.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/shared/clc_clamp.h>
 
 #define __CLC_BODY <clamp.inc>

diff  --git a/libclc/generic/lib/shared/clamp.inc b/libclc/opencl/lib/generic/shared/clamp.inc
similarity index 66%
rename from libclc/generic/lib/shared/clamp.inc
rename to libclc/opencl/lib/generic/shared/clamp.inc
index f3ef4476377df..f79a4da67f55a 100644
--- a/libclc/generic/lib/shared/clamp.inc
+++ b/libclc/opencl/lib/generic/shared/clamp.inc
@@ -6,12 +6,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z) {
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y,
+                                           __CLC_GENTYPE z) {
   return __clc_clamp(x, y, z);
 }
 
 #ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_SCALAR_GENTYPE y, __CLC_SCALAR_GENTYPE z) {
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x,
+                                           __CLC_SCALAR_GENTYPE y,
+                                           __CLC_SCALAR_GENTYPE z) {
   return __clc_clamp(x, y, z);
 }
 #endif

diff  --git a/libclc/generic/lib/shared/max.cl b/libclc/opencl/lib/generic/shared/max.cl
similarity index 94%
rename from libclc/generic/lib/shared/max.cl
rename to libclc/opencl/lib/generic/shared/max.cl
index 9ea532eca6b05..59f0b7e3b4c8e 100644
--- a/libclc/generic/lib/shared/max.cl
+++ b/libclc/opencl/lib/generic/shared/max.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/shared/clc_max.h>
 
 #define __CLC_BODY <max.inc>

diff  --git a/libclc/generic/lib/shared/max.inc b/libclc/opencl/lib/generic/shared/max.inc
similarity index 100%
rename from libclc/generic/lib/shared/max.inc
rename to libclc/opencl/lib/generic/shared/max.inc

diff  --git a/libclc/generic/lib/shared/min.cl b/libclc/opencl/lib/generic/shared/min.cl
similarity index 94%
rename from libclc/generic/lib/shared/min.cl
rename to libclc/opencl/lib/generic/shared/min.cl
index f7d043f224f8c..6c491c5eb1cbf 100644
--- a/libclc/generic/lib/shared/min.cl
+++ b/libclc/opencl/lib/generic/shared/min.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 #include <clc/shared/clc_min.h>
 
 #define __CLC_BODY <min.inc>

diff  --git a/libclc/generic/lib/shared/min.inc b/libclc/opencl/lib/generic/shared/min.inc
similarity index 100%
rename from libclc/generic/lib/shared/min.inc
rename to libclc/opencl/lib/generic/shared/min.inc

diff  --git a/libclc/generic/lib/shared/vload.cl b/libclc/opencl/lib/generic/shared/vload.cl
similarity index 99%
rename from libclc/generic/lib/shared/vload.cl
rename to libclc/opencl/lib/generic/shared/vload.cl
index dd3a0ada456ee..41f3629443e75 100644
--- a/libclc/generic/lib/shared/vload.cl
+++ b/libclc/opencl/lib/generic/shared/vload.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #define VLOAD_VECTORIZE(PRIM_TYPE, ADDR_SPACE)                                 \
   typedef PRIM_TYPE##2 less_aligned_##ADDR_SPACE##PRIM_TYPE##2                 \

diff  --git a/libclc/generic/lib/shared/vload_half.inc b/libclc/opencl/lib/generic/shared/vload_half.inc
similarity index 100%
rename from libclc/generic/lib/shared/vload_half.inc
rename to libclc/opencl/lib/generic/shared/vload_half.inc

diff  --git a/libclc/generic/lib/shared/vstore.cl b/libclc/opencl/lib/generic/shared/vstore.cl
similarity index 99%
rename from libclc/generic/lib/shared/vstore.cl
rename to libclc/opencl/lib/generic/shared/vstore.cl
index 5d039d07f5e29..78d5865aa1d17 100644
--- a/libclc/generic/lib/shared/vstore.cl
+++ b/libclc/opencl/lib/generic/shared/vstore.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 #pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable
 

diff  --git a/libclc/generic/lib/shared/vstore_half.inc b/libclc/opencl/lib/generic/shared/vstore_half.inc
similarity index 100%
rename from libclc/generic/lib/shared/vstore_half.inc
rename to libclc/opencl/lib/generic/shared/vstore_half.inc

diff  --git a/libclc/generic/lib/subnormal_config.cl b/libclc/opencl/lib/generic/subnormal_config.cl
similarity index 76%
rename from libclc/generic/lib/subnormal_config.cl
rename to libclc/opencl/lib/generic/subnormal_config.cl
index a77886800ba65..a32af9b0cf2e7 100644
--- a/libclc/generic/lib/subnormal_config.cl
+++ b/libclc/opencl/lib/generic/subnormal_config.cl
@@ -6,16 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_subnormal_config.h>
+#include <clc/opencl/clc.h>
 
-_CLC_DEF bool __clc_fp16_subnormals_supported() {
-  return false;
-}
+_CLC_DEF bool __clc_fp16_subnormals_supported() { return false; }
 
-_CLC_DEF bool __clc_fp32_subnormals_supported() {
-  return false;
-}
+_CLC_DEF bool __clc_fp32_subnormals_supported() { return false; }
 
 _CLC_DEF bool __clc_fp64_subnormals_supported() {
   return !__clc_subnormals_disabled();

diff  --git a/libclc/generic/lib/subnormal_disable.ll b/libclc/opencl/lib/generic/subnormal_disable.ll
similarity index 100%
rename from libclc/generic/lib/subnormal_disable.ll
rename to libclc/opencl/lib/generic/subnormal_disable.ll

diff  --git a/libclc/generic/lib/subnormal_helper_func.ll b/libclc/opencl/lib/generic/subnormal_helper_func.ll
similarity index 100%
rename from libclc/generic/lib/subnormal_helper_func.ll
rename to libclc/opencl/lib/generic/subnormal_helper_func.ll

diff  --git a/libclc/generic/lib/subnormal_use_default.ll b/libclc/opencl/lib/generic/subnormal_use_default.ll
similarity index 100%
rename from libclc/generic/lib/subnormal_use_default.ll
rename to libclc/opencl/lib/generic/subnormal_use_default.ll

diff  --git a/libclc/generic/lib/workitem/get_global_id.cl b/libclc/opencl/lib/generic/workitem/get_global_id.cl
similarity index 87%
rename from libclc/generic/lib/workitem/get_global_id.cl
rename to libclc/opencl/lib/generic/workitem/get_global_id.cl
index c1f384734e4d5..26c3bf528cd4d 100644
--- a/libclc/generic/lib/workitem/get_global_id.cl
+++ b/libclc/opencl/lib/generic/workitem/get_global_id.cl
@@ -6,8 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_id(uint dim) {
-  return get_group_id(dim) * get_local_size(dim) + get_local_id(dim) + get_global_offset(dim);
+  return get_group_id(dim) * get_local_size(dim) + get_local_id(dim) +
+         get_global_offset(dim);
 }

diff  --git a/libclc/generic/lib/workitem/get_global_size.cl b/libclc/opencl/lib/generic/workitem/get_global_size.cl
similarity index 84%
rename from libclc/generic/lib/workitem/get_global_size.cl
rename to libclc/opencl/lib/generic/workitem/get_global_size.cl
index 909d2b013c95f..747115d524885 100644
--- a/libclc/generic/lib/workitem/get_global_size.cl
+++ b/libclc/opencl/lib/generic/workitem/get_global_size.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_size(uint dim) {
-  return get_num_groups(dim)*get_local_size(dim);
+  return get_num_groups(dim) * get_local_size(dim);
 }

diff  --git a/libclc/ptx-nvidiacl/lib/SOURCES b/libclc/opencl/lib/ptx-nvidiacl/SOURCES
similarity index 100%
rename from libclc/ptx-nvidiacl/lib/SOURCES
rename to libclc/opencl/lib/ptx-nvidiacl/SOURCES

diff  --git a/libclc/ptx-nvidiacl/lib/mem_fence/fence.cl b/libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl
similarity index 96%
rename from libclc/ptx-nvidiacl/lib/mem_fence/fence.cl
rename to libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl
index 85ab3b427aaa9..284a0517d3308 100644
--- a/libclc/ptx-nvidiacl/lib/mem_fence/fence.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/mem_fence/fence.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD void mem_fence(cl_mem_fence_flags flags) {
   if (flags & (CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE))

diff  --git a/libclc/ptx-nvidiacl/lib/synchronization/barrier.cl b/libclc/opencl/lib/ptx-nvidiacl/synchronization/barrier.cl
similarity index 94%
rename from libclc/ptx-nvidiacl/lib/synchronization/barrier.cl
rename to libclc/opencl/lib/ptx-nvidiacl/synchronization/barrier.cl
index e10e15f44f689..173d771ccaa39 100644
--- a/libclc/ptx-nvidiacl/lib/synchronization/barrier.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/synchronization/barrier.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD void barrier(cl_mem_fence_flags flags) {
   __syncthreads();

diff  --git a/libclc/ptx-nvidiacl/lib/workitem/get_global_id.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_global_id.cl
similarity index 94%
rename from libclc/ptx-nvidiacl/lib/workitem/get_global_id.cl
rename to libclc/opencl/lib/ptx-nvidiacl/workitem/get_global_id.cl
index 0db82fbb7ac68..2f1f7cd4250fe 100644
--- a/libclc/ptx-nvidiacl/lib/workitem/get_global_id.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_global_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_global_id(uint dim) {
   return get_group_id(dim) * get_local_size(dim) + get_local_id(dim);

diff  --git a/libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl
similarity index 67%
rename from libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl
rename to libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl
index b9908ccb78e83..0dad4c2061fe6 100644
--- a/libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_group_id.cl
@@ -6,13 +6,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_group_id(uint dim) {
   switch (dim) {
-  case 0:  return __nvvm_read_ptx_sreg_ctaid_x();
-  case 1:  return __nvvm_read_ptx_sreg_ctaid_y();
-  case 2:  return __nvvm_read_ptx_sreg_ctaid_z();
-  default: return 0;
+  case 0:
+    return __nvvm_read_ptx_sreg_ctaid_x();
+  case 1:
+    return __nvvm_read_ptx_sreg_ctaid_y();
+  case 2:
+    return __nvvm_read_ptx_sreg_ctaid_z();
+  default:
+    return 0;
   }
 }

diff  --git a/libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl
similarity index 68%
rename from libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl
rename to libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl
index 1b36032ca97b5..199b4610bdb7b 100644
--- a/libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_id.cl
@@ -6,13 +6,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_local_id(uint dim) {
   switch (dim) {
-  case 0:  return __nvvm_read_ptx_sreg_tid_x();
-  case 1:  return __nvvm_read_ptx_sreg_tid_y();
-  case 2:  return __nvvm_read_ptx_sreg_tid_z();
-  default: return 0;
+  case 0:
+    return __nvvm_read_ptx_sreg_tid_x();
+  case 1:
+    return __nvvm_read_ptx_sreg_tid_y();
+  case 2:
+    return __nvvm_read_ptx_sreg_tid_z();
+  default:
+    return 0;
   }
 }

diff  --git a/libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl
similarity index 68%
rename from libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl
rename to libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl
index dee134e614f2a..a93fa0a3c9649 100644
--- a/libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_local_size.cl
@@ -6,13 +6,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_local_size(uint dim) {
   switch (dim) {
-  case 0:  return __nvvm_read_ptx_sreg_ntid_x();
-  case 1:  return __nvvm_read_ptx_sreg_ntid_y();
-  case 2:  return __nvvm_read_ptx_sreg_ntid_z();
-  default: return 0;
+  case 0:
+    return __nvvm_read_ptx_sreg_ntid_x();
+  case 1:
+    return __nvvm_read_ptx_sreg_ntid_y();
+  case 2:
+    return __nvvm_read_ptx_sreg_ntid_z();
+  default:
+    return 0;
   }
 }

diff  --git a/libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl
similarity index 67%
rename from libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl
rename to libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl
index 25cae3c9716ea..4c934968df865 100644
--- a/libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl
+++ b/libclc/opencl/lib/ptx-nvidiacl/workitem/get_num_groups.cl
@@ -6,13 +6,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD size_t get_num_groups(uint dim) {
   switch (dim) {
-  case 0:  return __nvvm_read_ptx_sreg_nctaid_x();
-  case 1:  return __nvvm_read_ptx_sreg_nctaid_y();
-  case 2:  return __nvvm_read_ptx_sreg_nctaid_z();
-  default: return 0;
+  case 0:
+    return __nvvm_read_ptx_sreg_nctaid_x();
+  case 1:
+    return __nvvm_read_ptx_sreg_nctaid_y();
+  case 2:
+    return __nvvm_read_ptx_sreg_nctaid_z();
+  default:
+    return 0;
   }
 }

diff  --git a/libclc/r600/lib/SOURCES b/libclc/opencl/lib/r600/SOURCES
similarity index 100%
rename from libclc/r600/lib/SOURCES
rename to libclc/opencl/lib/r600/SOURCES

diff  --git a/libclc/r600/lib/SOURCES_3.9 b/libclc/opencl/lib/r600/SOURCES_3.9
similarity index 100%
rename from libclc/r600/lib/SOURCES_3.9
rename to libclc/opencl/lib/r600/SOURCES_3.9

diff  --git a/libclc/r600/lib/image/get_image_attributes_impl.ll b/libclc/opencl/lib/r600/image/get_image_attributes_impl.ll
similarity index 100%
rename from libclc/r600/lib/image/get_image_attributes_impl.ll
rename to libclc/opencl/lib/r600/image/get_image_attributes_impl.ll

diff  --git a/libclc/r600/lib/image/get_image_channel_data_type.cl b/libclc/opencl/lib/r600/image/get_image_channel_data_type.cl
similarity index 77%
rename from libclc/r600/lib/image/get_image_channel_data_type.cl
rename to libclc/opencl/lib/r600/image/get_image_channel_data_type.cl
index d04cfd42a0588..813572ae5d2d7 100644
--- a/libclc/r600/lib/image/get_image_channel_data_type.cl
+++ b/libclc/opencl/lib/r600/image/get_image_channel_data_type.cl
@@ -6,16 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL int __clc_get_image_channel_data_type_2d(image2d_t);
 _CLC_DECL int __clc_get_image_channel_data_type_3d(image3d_t);
 
-_CLC_OVERLOAD _CLC_DEF int
-get_image_channel_data_type(image2d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_channel_data_type(image2d_t image) {
   return __clc_get_image_channel_data_type_2d(image);
 }
-_CLC_OVERLOAD _CLC_DEF int
-get_image_channel_data_type(image3d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_channel_data_type(image3d_t image) {
   return __clc_get_image_channel_data_type_3d(image);
 }

diff  --git a/libclc/r600/lib/image/get_image_channel_order.cl b/libclc/opencl/lib/r600/image/get_image_channel_order.cl
similarity index 77%
rename from libclc/r600/lib/image/get_image_channel_order.cl
rename to libclc/opencl/lib/r600/image/get_image_channel_order.cl
index 164804fa147c9..0e5882b155079 100644
--- a/libclc/r600/lib/image/get_image_channel_order.cl
+++ b/libclc/opencl/lib/r600/image/get_image_channel_order.cl
@@ -6,16 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL int __clc_get_image_channel_order_2d(image2d_t);
 _CLC_DECL int __clc_get_image_channel_order_3d(image3d_t);
 
-_CLC_OVERLOAD _CLC_DEF int
-get_image_channel_order(image2d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_channel_order(image2d_t image) {
   return __clc_get_image_channel_order_2d(image);
 }
-_CLC_OVERLOAD _CLC_DEF int
-get_image_channel_order(image3d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_channel_order(image3d_t image) {
   return __clc_get_image_channel_order_3d(image);
 }

diff  --git a/libclc/r600/lib/image/get_image_depth.cl b/libclc/opencl/lib/r600/image/get_image_depth.cl
similarity index 76%
rename from libclc/r600/lib/image/get_image_depth.cl
rename to libclc/opencl/lib/r600/image/get_image_depth.cl
index dd4b3747172b4..431889b6ca258 100644
--- a/libclc/r600/lib/image/get_image_depth.cl
+++ b/libclc/opencl/lib/r600/image/get_image_depth.cl
@@ -6,11 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL int __clc_get_image_depth_3d(image3d_t);
 
-_CLC_OVERLOAD _CLC_DEF int
-get_image_depth(image3d_t image) {
-	return __clc_get_image_depth_3d(image);
+_CLC_OVERLOAD _CLC_DEF int get_image_depth(image3d_t image) {
+  return __clc_get_image_depth_3d(image);
 }

diff  --git a/libclc/r600/lib/image/get_image_dim.cl b/libclc/opencl/lib/r600/image/get_image_dim.cl
similarity index 78%
rename from libclc/r600/lib/image/get_image_dim.cl
rename to libclc/opencl/lib/r600/image/get_image_dim.cl
index 1cb8d4d3a6dc0..5a123425a2910 100644
--- a/libclc/r600/lib/image/get_image_dim.cl
+++ b/libclc/opencl/lib/r600/image/get_image_dim.cl
@@ -6,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
-_CLC_OVERLOAD _CLC_DEF int2 get_image_dim (image2d_t image) {
+_CLC_OVERLOAD _CLC_DEF int2 get_image_dim(image2d_t image) {
   return (int2)(get_image_width(image), get_image_height(image));
 }
-_CLC_OVERLOAD _CLC_DEF int4 get_image_dim (image3d_t image) {
+_CLC_OVERLOAD _CLC_DEF int4 get_image_dim(image3d_t image) {
   return (int4)(get_image_width(image), get_image_height(image),
                 get_image_depth(image), 0);
 }

diff  --git a/libclc/r600/lib/image/get_image_height.cl b/libclc/opencl/lib/r600/image/get_image_height.cl
similarity index 78%
rename from libclc/r600/lib/image/get_image_height.cl
rename to libclc/opencl/lib/r600/image/get_image_height.cl
index 2d869e3183147..0c498bed8e608 100644
--- a/libclc/r600/lib/image/get_image_height.cl
+++ b/libclc/opencl/lib/r600/image/get_image_height.cl
@@ -6,16 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL int __clc_get_image_height_2d(image2d_t);
 _CLC_DECL int __clc_get_image_height_3d(image3d_t);
 
-_CLC_OVERLOAD _CLC_DEF int
-get_image_height(image2d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_height(image2d_t image) {
   return __clc_get_image_height_2d(image);
 }
-_CLC_OVERLOAD _CLC_DEF int
-get_image_height(image3d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_height(image3d_t image) {
   return __clc_get_image_height_3d(image);
 }

diff  --git a/libclc/r600/lib/image/get_image_width.cl b/libclc/opencl/lib/r600/image/get_image_width.cl
similarity index 78%
rename from libclc/r600/lib/image/get_image_width.cl
rename to libclc/opencl/lib/r600/image/get_image_width.cl
index a0c68f15e006a..c54f66176e764 100644
--- a/libclc/r600/lib/image/get_image_width.cl
+++ b/libclc/opencl/lib/r600/image/get_image_width.cl
@@ -6,16 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL int __clc_get_image_width_2d(image2d_t);
 _CLC_DECL int __clc_get_image_width_3d(image3d_t);
 
-_CLC_OVERLOAD _CLC_DEF int
-get_image_width(image2d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_width(image2d_t image) {
   return __clc_get_image_width_2d(image);
 }
-_CLC_OVERLOAD _CLC_DEF int
-get_image_width(image3d_t image) {
+_CLC_OVERLOAD _CLC_DEF int get_image_width(image3d_t image) {
   return __clc_get_image_width_3d(image);
 }

diff  --git a/libclc/r600/lib/image/read_image_impl.ll b/libclc/opencl/lib/r600/image/read_image_impl.ll
similarity index 97%
rename from libclc/r600/lib/image/read_image_impl.ll
rename to libclc/opencl/lib/r600/image/read_image_impl.ll
index 9187469b191f0..00b80b63f4f7d 100644
--- a/libclc/r600/lib/image/read_image_impl.ll
+++ b/libclc/opencl/lib/r600/image/read_image_impl.ll
@@ -17,7 +17,7 @@ declare i32 @llvm.OpenCL.sampler.get.resource.id(i32) readnone
 define <4 x float> @__clc_v4f_from_v2f(<2 x float> %v) alwaysinline {
   %e0 = extractelement <2 x float> %v, i32 0
   %e1 = extractelement <2 x float> %v, i32 1
-  %res.0 = insertelement <4 x float> undef,  float %e0, i32 0
+  %res.0 = insertelement <4 x float> poison, float %e0, i32 0
   %res.1 = insertelement <4 x float> %res.0, float %e1, i32 1
   %res.2 = insertelement <4 x float> %res.1, float 0.0, i32 2
   %res.3 = insertelement <4 x float> %res.2, float 0.0, i32 3

diff  --git a/libclc/r600/lib/image/read_imagef.cl b/libclc/opencl/lib/r600/image/read_imagef.cl
similarity index 96%
rename from libclc/r600/lib/image/read_imagef.cl
rename to libclc/opencl/lib/r600/image/read_imagef.cl
index 010f3cd59e1fb..54983363e33c5 100644
--- a/libclc/r600/lib/image/read_imagef.cl
+++ b/libclc/opencl/lib/r600/image/read_imagef.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL float4 __clc_read_imagef_tex(image2d_t, sampler_t, float2);
 

diff  --git a/libclc/r600/lib/image/read_imagei.cl b/libclc/opencl/lib/r600/image/read_imagei.cl
similarity index 85%
rename from libclc/r600/lib/image/read_imagei.cl
rename to libclc/opencl/lib/r600/image/read_imagei.cl
index fbdf4f7f7c58a..918a444f90a11 100644
--- a/libclc/r600/lib/image/read_imagei.cl
+++ b/libclc/opencl/lib/r600/image/read_imagei.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL float4 __clc_read_imagef_tex(image2d_t, sampler_t, float2);
 
@@ -14,7 +14,7 @@ int4 __clc_reinterpret_v4f_to_v4i(float4 v) {
   union {
     int4 v4i;
     float4 v4f;
-  } res = { .v4f = v};
+  } res = {.v4f = v};
   return res.v4i;
 }
 
@@ -22,10 +22,10 @@ _CLC_OVERLOAD _CLC_DEF int4 read_imagei(image2d_t image, sampler_t sampler,
                                         int2 coord) {
   float2 coord_float = (float2)(coord.x, coord.y);
   return __clc_reinterpret_v4f_to_v4i(
-    __clc_read_imagef_tex(image, sampler, coord_float));
+      __clc_read_imagef_tex(image, sampler, coord_float));
 }
 _CLC_OVERLOAD _CLC_DEF int4 read_imagei(image2d_t image, sampler_t sampler,
                                         float2 coord) {
   return __clc_reinterpret_v4f_to_v4i(
-    __clc_read_imagef_tex(image, sampler, coord));
+      __clc_read_imagef_tex(image, sampler, coord));
 }

diff  --git a/libclc/r600/lib/image/read_imageui.cl b/libclc/opencl/lib/r600/image/read_imageui.cl
similarity index 85%
rename from libclc/r600/lib/image/read_imageui.cl
rename to libclc/opencl/lib/r600/image/read_imageui.cl
index bd0024776fe18..8236b542ea0e8 100644
--- a/libclc/r600/lib/image/read_imageui.cl
+++ b/libclc/opencl/lib/r600/image/read_imageui.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL float4 __clc_read_imagef_tex(image2d_t, sampler_t, float2);
 
@@ -14,7 +14,7 @@ uint4 __clc_reinterpret_v4f_to_v4ui(float4 v) {
   union {
     uint4 v4ui;
     float4 v4f;
-  } res = { .v4f = v};
+  } res = {.v4f = v};
   return res.v4ui;
 }
 
@@ -22,10 +22,10 @@ _CLC_OVERLOAD _CLC_DEF uint4 read_imageui(image2d_t image, sampler_t sampler,
                                           int2 coord) {
   float2 coord_float = (float2)(coord.x, coord.y);
   return __clc_reinterpret_v4f_to_v4ui(
-    __clc_read_imagef_tex(image, sampler, coord_float));
+      __clc_read_imagef_tex(image, sampler, coord_float));
 }
 _CLC_OVERLOAD _CLC_DEF uint4 read_imageui(image2d_t image, sampler_t sampler,
                                           float2 coord) {
   return __clc_reinterpret_v4f_to_v4ui(
-    __clc_read_imagef_tex(image, sampler, coord));
+      __clc_read_imagef_tex(image, sampler, coord));
 }

diff  --git a/libclc/r600/lib/image/write_image_impl.ll b/libclc/opencl/lib/r600/image/write_image_impl.ll
similarity index 97%
rename from libclc/r600/lib/image/write_image_impl.ll
rename to libclc/opencl/lib/r600/image/write_image_impl.ll
index f3dea44c7927c..0759f0e2f9449 100644
--- a/libclc/r600/lib/image/write_image_impl.ll
+++ b/libclc/opencl/lib/r600/image/write_image_impl.ll
@@ -23,7 +23,7 @@ define void @__clc_write_imageui_2d(
   ; Coordinate int2 -> int4.
   %e0 = extractelement <2 x i32> %coord, i32 0
   %e1 = extractelement <2 x i32> %coord, i32 1
-  %coord.0 = insertelement <4 x i32> undef,    i32 %e0, i32 0
+  %coord.0 = insertelement <4 x i32> poison,   i32 %e0, i32 0
   %coord.1 = insertelement <4 x i32> %coord.0, i32 %e1, i32 1
   %coord.2 = insertelement <4 x i32> %coord.1, i32 0,  i32 2
   %coord.3 = insertelement <4 x i32> %coord.2, i32 0,  i32 3

diff  --git a/libclc/r600/lib/image/write_imagef.cl b/libclc/opencl/lib/r600/image/write_imagef.cl
similarity index 76%
rename from libclc/r600/lib/image/write_imagef.cl
rename to libclc/opencl/lib/r600/image/write_imagef.cl
index cd16dceb0f190..d9784f5322c94 100644
--- a/libclc/r600/lib/image/write_imagef.cl
+++ b/libclc/opencl/lib/r600/image/write_imagef.cl
@@ -6,12 +6,11 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL void __clc_write_imagef_2d(image2d_t image, int2 coord, float4 color);
 
-_CLC_OVERLOAD _CLC_DEF void
-write_imagef(image2d_t image, int2 coord, float4 color)
-{
+_CLC_OVERLOAD _CLC_DEF void write_imagef(image2d_t image, int2 coord,
+                                         float4 color) {
   __clc_write_imagef_2d(image, coord, color);
 }

diff  --git a/libclc/r600/lib/image/write_imagei.cl b/libclc/opencl/lib/r600/image/write_imagei.cl
similarity index 76%
rename from libclc/r600/lib/image/write_imagei.cl
rename to libclc/opencl/lib/r600/image/write_imagei.cl
index dae95e0743a25..ced65184071b3 100644
--- a/libclc/r600/lib/image/write_imagei.cl
+++ b/libclc/opencl/lib/r600/image/write_imagei.cl
@@ -6,12 +6,11 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL void __clc_write_imagei_2d(image2d_t image, int2 coord, int4 color);
 
-_CLC_OVERLOAD _CLC_DEF void
-write_imagei(image2d_t image, int2 coord, int4 color)
-{
+_CLC_OVERLOAD _CLC_DEF void write_imagei(image2d_t image, int2 coord,
+                                         int4 color) {
   __clc_write_imagei_2d(image, coord, color);
 }

diff  --git a/libclc/r600/lib/image/write_imageui.cl b/libclc/opencl/lib/r600/image/write_imageui.cl
similarity index 76%
rename from libclc/r600/lib/image/write_imageui.cl
rename to libclc/opencl/lib/r600/image/write_imageui.cl
index 3524ad57e5b1c..ef2ee5a835ec7 100644
--- a/libclc/r600/lib/image/write_imageui.cl
+++ b/libclc/opencl/lib/r600/image/write_imageui.cl
@@ -6,12 +6,11 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DECL void __clc_write_imageui_2d(image2d_t image, int2 coord, uint4 color);
 
-_CLC_OVERLOAD _CLC_DEF void
-write_imageui(image2d_t image, int2 coord, uint4 color)
-{
+_CLC_OVERLOAD _CLC_DEF void write_imageui(image2d_t image, int2 coord,
+                                          uint4 color) {
   __clc_write_imageui_2d(image, coord, color);
 }

diff  --git a/libclc/r600/lib/synchronization/barrier.cl b/libclc/opencl/lib/r600/synchronization/barrier.cl
similarity index 95%
rename from libclc/r600/lib/synchronization/barrier.cl
rename to libclc/opencl/lib/r600/synchronization/barrier.cl
index c235be90b7f16..83438efa26498 100644
--- a/libclc/r600/lib/synchronization/barrier.cl
+++ b/libclc/opencl/lib/r600/synchronization/barrier.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF void __clc_r600_barrier(void) __asm("llvm.r600.group.barrier");
 

diff  --git a/libclc/r600/lib/workitem/get_global_offset.cl b/libclc/opencl/lib/r600/workitem/get_global_offset.cl
similarity index 95%
rename from libclc/r600/lib/workitem/get_global_offset.cl
rename to libclc/opencl/lib/r600/workitem/get_global_offset.cl
index 1c47108df9a6a..cc42fe4beef0c 100644
--- a/libclc/r600/lib/workitem/get_global_offset.cl
+++ b/libclc/opencl/lib/r600/workitem/get_global_offset.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD uint get_global_offset(uint dim) {
   __attribute__((address_space(7))) uint *ptr =

diff  --git a/libclc/r600/lib/workitem/get_global_size.cl b/libclc/opencl/lib/r600/workitem/get_global_size.cl
similarity index 96%
rename from libclc/r600/lib/workitem/get_global_size.cl
rename to libclc/opencl/lib/r600/workitem/get_global_size.cl
index b95accc8d830b..1c93568f80c74 100644
--- a/libclc/r600/lib/workitem/get_global_size.cl
+++ b/libclc/opencl/lib/r600/workitem/get_global_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 uint __clc_r600_get_global_size_x(void) __asm("llvm.r600.read.global.size.x");
 uint __clc_r600_get_global_size_y(void) __asm("llvm.r600.read.global.size.y");

diff  --git a/libclc/r600/lib/workitem/get_group_id.cl b/libclc/opencl/lib/r600/workitem/get_group_id.cl
similarity index 95%
rename from libclc/r600/lib/workitem/get_group_id.cl
rename to libclc/opencl/lib/r600/workitem/get_group_id.cl
index b31431e903aed..c771e835cda12 100644
--- a/libclc/r600/lib/workitem/get_group_id.cl
+++ b/libclc/opencl/lib/r600/workitem/get_group_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD uint get_group_id(uint dim) {
   switch (dim) {

diff  --git a/libclc/r600/lib/workitem/get_local_id.cl b/libclc/opencl/lib/r600/workitem/get_local_id.cl
similarity index 95%
rename from libclc/r600/lib/workitem/get_local_id.cl
rename to libclc/opencl/lib/r600/workitem/get_local_id.cl
index 2241715c2c70c..9d8e044812f24 100644
--- a/libclc/r600/lib/workitem/get_local_id.cl
+++ b/libclc/opencl/lib/r600/workitem/get_local_id.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD uint get_local_id(uint dim) {
   switch (dim) {

diff  --git a/libclc/r600/lib/workitem/get_local_size.cl b/libclc/opencl/lib/r600/workitem/get_local_size.cl
similarity index 96%
rename from libclc/r600/lib/workitem/get_local_size.cl
rename to libclc/opencl/lib/r600/workitem/get_local_size.cl
index 97e6b41ca7c6a..3755cf5e8b0e6 100644
--- a/libclc/r600/lib/workitem/get_local_size.cl
+++ b/libclc/opencl/lib/r600/workitem/get_local_size.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 uint __clc_r600_get_local_size_x(void) __asm("llvm.r600.read.local.size.x");
 uint __clc_r600_get_local_size_y(void) __asm("llvm.r600.read.local.size.y");

diff  --git a/libclc/r600/lib/workitem/get_num_groups.cl b/libclc/opencl/lib/r600/workitem/get_num_groups.cl
similarity index 96%
rename from libclc/r600/lib/workitem/get_num_groups.cl
rename to libclc/opencl/lib/r600/workitem/get_num_groups.cl
index 564189daf4fbd..088a055aabfce 100644
--- a/libclc/r600/lib/workitem/get_num_groups.cl
+++ b/libclc/opencl/lib/r600/workitem/get_num_groups.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 uint __clc_r600_get_num_groups_x(void) __asm("llvm.r600.read.ngroups.x");
 uint __clc_r600_get_num_groups_y(void) __asm("llvm.r600.read.ngroups.y");

diff  --git a/libclc/r600/lib/workitem/get_work_dim.cl b/libclc/opencl/lib/r600/workitem/get_work_dim.cl
similarity index 95%
rename from libclc/r600/lib/workitem/get_work_dim.cl
rename to libclc/opencl/lib/r600/workitem/get_work_dim.cl
index 0fadbe34e17d6..b59dd3af6c334 100644
--- a/libclc/r600/lib/workitem/get_work_dim.cl
+++ b/libclc/opencl/lib/r600/workitem/get_work_dim.cl
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF _CLC_OVERLOAD uint get_work_dim(void) {
   __attribute__((address_space(7))) uint *ptr =

diff  --git a/libclc/opencl/lib/spirv/SOURCES b/libclc/opencl/lib/spirv/SOURCES
new file mode 100644
index 0000000000000..0aa923978e9f1
--- /dev/null
+++ b/libclc/opencl/lib/spirv/SOURCES
@@ -0,0 +1,73 @@
+subnormal_config.cl
+../generic/async/async_work_group_strided_copy.cl
+../generic/async/wait_group_events.cl
+../generic/common/degrees.cl
+../generic/common/mix.cl
+../generic/common/radians.cl
+../generic/common/sign.cl
+../generic/common/smoothstep.cl
+../generic/common/step.cl
+../generic/geometric/cross.cl
+../generic/geometric/distance.cl
+../generic/geometric/dot.cl
+../generic/geometric/fast_distance.cl
+../generic/geometric/fast_length.cl
+../generic/geometric/fast_normalize.cl
+../generic/geometric/length.cl
+../generic/geometric/normalize.cl
+../generic/integer/rotate.cl
+../generic/integer/mad_sat.cl
+../generic/math/acos.cl
+../generic/math/acosh.cl
+../generic/math/acospi.cl
+../generic/math/asin.cl
+../generic/math/asinh.cl
+../generic/math/asinpi.cl
+../generic/math/atan.cl
+../generic/math/atan2.cl
+../generic/math/atan2pi.cl
+../generic/math/atanh.cl
+../generic/math/atanpi.cl
+../generic/math/cbrt.cl
+../generic/math/cos.cl
+../generic/math/cosh.cl
+../generic/math/cospi.cl
+../generic/math/erf.cl
+../generic/math/erfc.cl
+../generic/math/exp.cl
+../generic/math/expm1.cl
+../generic/math/exp2.cl
+../generic/math/exp10.cl
+math/fma.cl
+../generic/math/fmod.cl
+../generic/math/fract.cl
+../generic/math/frexp.cl
+../generic/math/half_rsqrt.cl
+../generic/math/half_sqrt.cl
+../generic/math/hypot.cl
+../generic/math/ilogb.cl
+../generic/math/ldexp.cl
+../generic/math/lgamma.cl
+../generic/math/lgamma_r.cl
+../generic/math/log.cl
+../generic/math/log10.cl
+../generic/math/log1p.cl
+../generic/math/log2.cl
+../generic/math/logb.cl
+../generic/math/modf.cl
+../generic/math/pow.cl
+../generic/math/pown.cl
+../generic/math/powr.cl
+../generic/math/remainder.cl
+../generic/math/remquo.cl
+../generic/math/rootn.cl
+../generic/math/sin.cl
+../generic/math/sincos.cl
+../generic/math/sinh.cl
+../generic/math/sinpi.cl
+../generic/math/tan.cl
+../generic/math/tanh.cl
+../generic/math/tanpi.cl
+../generic/math/tgamma.cl
+../generic/shared/vload.cl
+../generic/shared/vstore.cl

diff  --git a/libclc/clspv/lib/math/fma.cl b/libclc/opencl/lib/spirv/math/fma.cl
similarity index 94%
rename from libclc/clspv/lib/math/fma.cl
rename to libclc/opencl/lib/spirv/math/fma.cl
index 0f3e4222dc557..2722018121224 100644
--- a/libclc/clspv/lib/math/fma.cl
+++ b/libclc/opencl/lib/spirv/math/fma.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/clcmacro.h>
 #include <clc/internal/math/clc_sw_fma.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEFINE_TERNARY_BUILTIN(float, fma, __clc_sw_fma, float, float, float)

diff  --git a/libclc/clspv/lib/subnormal_config.cl b/libclc/opencl/lib/spirv/subnormal_config.cl
similarity index 95%
rename from libclc/clspv/lib/subnormal_config.cl
rename to libclc/opencl/lib/spirv/subnormal_config.cl
index ef0e1d7742447..77d60ab9cbbde 100644
--- a/libclc/clspv/lib/subnormal_config.cl
+++ b/libclc/opencl/lib/spirv/subnormal_config.cl
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <clc/clc.h>
 #include <clc/math/clc_subnormal_config.h>
+#include <clc/opencl/clc.h>
 
 _CLC_DEF bool __clc_fp16_subnormals_supported() { return false; }
 

diff  --git a/libclc/spirv/lib/SOURCES b/libclc/spirv/lib/SOURCES
deleted file mode 100644
index f3852ebe3e3e6..0000000000000
--- a/libclc/spirv/lib/SOURCES
+++ /dev/null
@@ -1,73 +0,0 @@
-subnormal_config.cl
-../../generic/lib/async/async_work_group_strided_copy.cl
-../../generic/lib/async/wait_group_events.cl
-../../generic/lib/common/degrees.cl
-../../generic/lib/common/mix.cl
-../../generic/lib/common/radians.cl
-../../generic/lib/common/sign.cl
-../../generic/lib/common/smoothstep.cl
-../../generic/lib/common/step.cl
-../../generic/lib/geometric/cross.cl
-../../generic/lib/geometric/distance.cl
-../../generic/lib/geometric/dot.cl
-../../generic/lib/geometric/fast_distance.cl
-../../generic/lib/geometric/fast_length.cl
-../../generic/lib/geometric/fast_normalize.cl
-../../generic/lib/geometric/length.cl
-../../generic/lib/geometric/normalize.cl
-../../generic/lib/integer/rotate.cl
-../../generic/lib/integer/mad_sat.cl
-../../generic/lib/math/acos.cl
-../../generic/lib/math/acosh.cl
-../../generic/lib/math/acospi.cl
-../../generic/lib/math/asin.cl
-../../generic/lib/math/asinh.cl
-../../generic/lib/math/asinpi.cl
-../../generic/lib/math/atan.cl
-../../generic/lib/math/atan2.cl
-../../generic/lib/math/atan2pi.cl
-../../generic/lib/math/atanh.cl
-../../generic/lib/math/atanpi.cl
-../../generic/lib/math/cbrt.cl
-../../generic/lib/math/cos.cl
-../../generic/lib/math/cosh.cl
-../../generic/lib/math/cospi.cl
-../../generic/lib/math/erf.cl
-../../generic/lib/math/erfc.cl
-../../generic/lib/math/exp.cl
-../../generic/lib/math/expm1.cl
-../../generic/lib/math/exp2.cl
-../../generic/lib/math/exp10.cl
-math/fma.cl
-../../generic/lib/math/fmod.cl
-../../generic/lib/math/fract.cl
-../../generic/lib/math/frexp.cl
-../../generic/lib/math/half_rsqrt.cl
-../../generic/lib/math/half_sqrt.cl
-../../generic/lib/math/hypot.cl
-../../generic/lib/math/ilogb.cl
-../../generic/lib/math/ldexp.cl
-../../generic/lib/math/lgamma.cl
-../../generic/lib/math/lgamma_r.cl
-../../generic/lib/math/log.cl
-../../generic/lib/math/log10.cl
-../../generic/lib/math/log1p.cl
-../../generic/lib/math/log2.cl
-../../generic/lib/math/logb.cl
-../../generic/lib/math/modf.cl
-../../generic/lib/math/pow.cl
-../../generic/lib/math/pown.cl
-../../generic/lib/math/powr.cl
-../../generic/lib/math/remainder.cl
-../../generic/lib/math/remquo.cl
-../../generic/lib/math/rootn.cl
-../../generic/lib/math/sin.cl
-../../generic/lib/math/sincos.cl
-../../generic/lib/math/sinh.cl
-../../generic/lib/math/sinpi.cl
-../../generic/lib/math/tan.cl
-../../generic/lib/math/tanh.cl
-../../generic/lib/math/tanpi.cl
-../../generic/lib/math/tgamma.cl
-../../generic/lib/shared/vload.cl
-../../generic/lib/shared/vstore.cl

diff  --git a/libclc/generic/lib/gen_convert.py b/libclc/utils/gen_convert.py
similarity index 99%
rename from libclc/generic/lib/gen_convert.py
rename to libclc/utils/gen_convert.py
index b8c7050095fc8..02893dbad6a37 100644
--- a/libclc/generic/lib/gen_convert.py
+++ b/libclc/utils/gen_convert.py
@@ -167,7 +167,7 @@ def conditional_guard(src, dst):
 nl = "\n"
 includes = []
 if not clc:
-    includes = ["<clc/clc.h>"]
+    includes = ["<clc/opencl/clc.h>"]
 else:
     includes = sorted(
         [
@@ -355,7 +355,6 @@ def generate_saturated_conversion(src, dst, size):
         print("  return x;")
 
     elif src in float_types:
-
         # Conversion from float to int
         print(
             f"""  {dstn} y = __clc_convert_{dstn}(x);
@@ -364,7 +363,6 @@ def generate_saturated_conversion(src, dst, size):
   return y;"""
         )
     else:
-
         # Integer to integer convesion with sizeof(src) == sizeof(dst)
         if sizeof_type[src] == sizeof_type[dst]:
             if src in unsigned_types:


        


More information about the cfe-commits mailing list