//
// /build/openvkl/src/build/openvkl/devices/cpu/ispc_openvkl_module_cpu_device_16_avx512skx-i32x16sse2/VdbIterator_ispc.h
// (Header automatically generated by the ispc compiler.)
// DO NOT EDIT THIS FILE.
//

#pragma once
#include <stdint.h>



#ifdef __cplusplus
namespace ispc { /* namespace */
#endif // __cplusplus

///////////////////////////////////////////////////////////////////////////
// Enumerator types with external visibility from ispc code
///////////////////////////////////////////////////////////////////////////

#ifndef __ISPC_ENUM_VKLFilter__
#define __ISPC_ENUM_VKLFilter__
enum VKLFilter {
    VKL_FILTER_NEAREST = 0,
    VKL_FILTER_LINEAR = 100,
    VKL_FILTER_CUBIC = 200 
};
#endif

#ifndef __ISPC_ENUM_DeviceVolumeType__
#define __ISPC_ENUM_DeviceVolumeType__
enum DeviceVolumeType {
    VOLUME_TYPE_UNKNOWN = 0,
    VOLUME_TYPE_STRUCTURED_REGULAR_LEGACY = 1,
    VOLUME_TYPE_STRUCTURED_REGULAR = 2,
    VOLUME_TYPE_STRUCTURED_SPHERICAL = 3,
    VOLUME_TYPE_VDB = 4,
    VOLUME_TYPE_AMR = 5,
    VOLUME_TYPE_UNSTRUCTURED = 6,
    VOLUME_TYPE_PARTICLE = 7 
};
#endif

#ifndef __ISPC_ENUM_VKLTemporalFormat__
#define __ISPC_ENUM_VKLTemporalFormat__
enum VKLTemporalFormat {
    VKL_TEMPORAL_FORMAT_CONSTANT = 0,
    VKL_TEMPORAL_FORMAT_STRUCTURED = 1,
    VKL_TEMPORAL_FORMAT_UNSTRUCTURED = 2,
    VKL_TEMPORAL_FORMAT_INVALID = 100 
};
#endif


/* Portable alignment macro that works across different compilers and standards */
#if defined(__cplusplus) && __cplusplus >= 201103L
/* C++11 or newer - use alignas keyword */
#define __ISPC_ALIGN__(x) alignas(x)
#elif defined(__GNUC__) || defined(__clang__)
/* GCC or Clang - use __attribute__ */
#define __ISPC_ALIGN__(x) __attribute__((aligned(x)))
#elif defined(_MSC_VER)
/* Microsoft Visual C++ - use __declspec */
#define __ISPC_ALIGN__(x) __declspec(align(x))
#else
/* Unknown compiler/standard - alignment not supported */
#define __ISPC_ALIGN__(x)
#warning "Alignment not supported on this compiler"
#endif // defined(__cplusplus) && __cplusplus >= 201103L
#ifndef __ISPC_ALIGNED_STRUCT__
#if defined(__clang__) || !defined(_MSC_VER) || _MSC_VER > 1943
// Clang, GCC, ICC, Visual Studio
#define __ISPC_ALIGNED_STRUCT__(s) struct __ISPC_ALIGN__(s)
#else
// Older Visual Studio
#define __ISPC_ALIGNED_STRUCT__(s) __ISPC_ALIGN__(s) struct
#endif // defined(__clang__) || !defined(_MSC_VER) || _MSC_VER > 1943
#endif // __ISPC_ALIGNED_STRUCT__

#ifndef __ISPC_STRUCT_box1f__
#define __ISPC_STRUCT_box1f__
struct box1f {
    float lower;
    float upper;
};
#endif

#ifndef __ISPC_STRUCT_IntervalIteratorShared__
#define __ISPC_STRUCT_IntervalIteratorShared__
struct IntervalIteratorShared {
    const struct IntervalIteratorContext * context;
};
#endif

#ifndef __ISPC_STRUCT_DefaultHitIteratorIntervalIterator__
#define __ISPC_STRUCT_DefaultHitIteratorIntervalIterator__
struct DefaultHitIteratorIntervalIterator {
    struct IntervalIteratorShared super;

#if defined(__cplusplus)
    void ( * iterate)(const int32_t * imask, void * _self, void * _interval, const struct ValueRanges &valueRanges, const bool elementaryCellIteration, int32_t * _result);
#else
    void ( * iterate)(const int32_t * imask, void * _self, void * _interval, const struct ValueRanges *valueRanges, const bool elementaryCellIteration, int32_t * _result);
#endif // iterate field
    bool elementaryCellIterationSupported;
};
#endif

#ifndef __ISPC_STRUCT_v16_varying_vec3f__
#define __ISPC_STRUCT_v16_varying_vec3f__
__ISPC_ALIGNED_STRUCT__(64) v16_varying_vec3f {
    __ISPC_ALIGN__(64)     float x[16];
    __ISPC_ALIGN__(64)     float y[16];
    __ISPC_ALIGN__(64)     float z[16];
};
#endif

#ifndef __ISPC_STRUCT_v16_varying_DdaState__
#define __ISPC_STRUCT_v16_varying_DdaState__
__ISPC_ALIGNED_STRUCT__(64) v16_varying_DdaState {
    uint32_t level;
    __ISPC_ALIGN__(64)     float t[16];
    struct v16_varying_vec3f rayOrg;
    struct v16_varying_vec3f rayDir;
    __ISPC_ALIGN__(64)     int32_t idx[12][16];
    __ISPC_ALIGN__(64)     float tNext[12][16];
    __ISPC_ALIGN__(64)     float tDelta[12][16];
    __ISPC_ALIGN__(64)     int32_t idxDelta[12][16];
};
#endif

#ifndef __ISPC_STRUCT_v16_varying_VdbIterator__
#define __ISPC_STRUCT_v16_varying_VdbIterator__
__ISPC_ALIGNED_STRUCT__(64) v16_varying_VdbIterator {
    struct DefaultHitIteratorIntervalIterator super;
    const struct VdbGrid * grid;
    __ISPC_ALIGN__(64)     float tMax[16];
    __ISPC_ALIGN__(64)     float nominalDeltaT[16];
    struct v16_varying_DdaState dda;
};
#endif

#ifndef __ISPC_STRUCT_ValueRanges__
#define __ISPC_STRUCT_ValueRanges__
struct ValueRanges {
    int32_t numRanges;
    struct box1f * ranges;
    struct box1f rangesMinMax;
};
#endif

#ifndef __ISPC_STRUCT_IteratorContext__
#define __ISPC_STRUCT_IteratorContext__
struct IteratorContext {
    const struct SamplerShared * sampler;
    uint32_t attributeIndex;
    struct ValueRanges valueRanges;
    uint32_t maxIteratorDepth;
    bool elementaryCellIteration;
};
#endif

#ifndef __ISPC_STRUCT_IntervalIteratorContext__
#define __ISPC_STRUCT_IntervalIteratorContext__
struct IntervalIteratorContext {
    struct IteratorContext super;
};
#endif

#ifndef __ISPC_STRUCT_SamplerShared__
#define __ISPC_STRUCT_SamplerShared__
struct SamplerShared {
    const struct VolumeShared * volume;

#if defined(__cplusplus)
    float ( * computeSample_uniform)(const struct SamplerShared * _self, const struct vec3f &objectCoordinates, const uint32_t attributeIndex, const float &time);
#else
    float ( * computeSample_uniform)(const struct SamplerShared * _self, const struct vec3f *objectCoordinates, const uint32_t attributeIndex, const float *time);
#endif // computeSample_uniform field

#if defined(__cplusplus)
    float ( * computeSample_varying)(const struct SamplerShared * _self, const struct v16_varying_vec3f &objectCoordinates, const uint32_t attributeIndex, const float &time);
#else
    float ( * computeSample_varying)(const struct SamplerShared * _self, const struct v16_varying_vec3f *objectCoordinates, const uint32_t attributeIndex, const float *time);
#endif // computeSample_varying field

#if defined(__cplusplus)
    struct v16_varying_vec3f ( * computeGradient_varying)(const struct SamplerShared * _self, const struct v16_varying_vec3f &objectCoordinates);
#else
    struct v16_varying_vec3f ( * computeGradient_varying)(const struct SamplerShared * _self, const struct v16_varying_vec3f *objectCoordinates);
#endif // computeGradient_varying field
    enum VKLFilter filter;
    enum VKLFilter gradientFilter;
};
#endif

#ifndef __ISPC_STRUCT_VolumeShared__
#define __ISPC_STRUCT_VolumeShared__
struct VolumeShared {
    enum DeviceVolumeType type;
    const float * background;
};
#endif

#ifndef __ISPC_STRUCT_vec3f__
#define __ISPC_STRUCT_vec3f__
struct vec3f {
    float x;
    float y;
    float z;
};
#endif

#ifndef __ISPC_STRUCT_vec3i__
#define __ISPC_STRUCT_vec3i__
struct vec3i {
    int32_t x;
    int32_t y;
    int32_t z;
};
#endif

#ifndef __ISPC_STRUCT_vec3ui__
#define __ISPC_STRUCT_vec3ui__
struct vec3ui {
    uint32_t x;
    uint32_t y;
    uint32_t z;
};
#endif

#ifndef __ISPC_STRUCT_box3f__
#define __ISPC_STRUCT_box3f__
struct box3f {
    struct vec3f lower;
    struct vec3f upper;
};
#endif

#ifndef __ISPC_STRUCT_Data1D__
#define __ISPC_STRUCT_Data1D__
struct Data1D {
    const uint8_t * addr;
    uint64_t byteStride;
    uint64_t numItems;
    uint32_t dataType;
    bool compact;
};
#endif

#ifndef __ISPC_STRUCT_VdbLevel__
#define __ISPC_STRUCT_VdbLevel__
struct VdbLevel {
    uint64_t numNodes;
    struct vec3ui * origin;
    uint64_t * voxels;
    struct box1f * valueRange;
};
#endif

#ifndef __ISPC_STRUCT_VdbGrid__
#define __ISPC_STRUCT_VdbGrid__
struct VdbGrid {
    float objectToIndex[12];
    float indexToObject[12];
    struct vec3i rootOrigin;
    struct vec3ui activeSize;
    struct box3f domainBoundingBox;
    bool constantCellData;
    uint64_t numLeaves;
    uint32_t numAttributes;
    bool allLeavesCompact;
    bool allLeavesConstant;
    uint32_t * attributeTypes;
    const int32_t * leafStructuredTimesteps;
    struct Data1D * leafUnstructuredIndices;
    struct Data1D * leafUnstructuredTimes;
    struct Data1D * leafData;
    bool packedAddressing32;
    struct Data1D * nodesPackedDense;
    struct Data1D * nodesPackedTile;
    bool dense;
    struct vec3i denseDimensions;
    struct Data1D * denseData;
    enum VKLTemporalFormat denseTemporalFormat;
    int32_t denseTemporallyStructuredNumTimesteps;
    struct Data1D denseTemporallyUnstructuredIndices;
    struct Data1D denseTemporallyUnstructuredTimes;
    struct VdbLevel levels[3];
};
#endif


///////////////////////////////////////////////////////////////////////////
// Functions exported from ispc code
///////////////////////////////////////////////////////////////////////////
#if defined(__cplusplus) && (! defined(__ISPC_NO_EXTERN_C) || !__ISPC_NO_EXTERN_C )
extern "C" {
#endif // __cplusplus
    extern void Sampler_create16(const void * _volume, void * _sampler);
    extern void Sampler_destroy16(void * _sampler);
    extern void Sampler_setFilters16(void * _sampler, enum VKLFilter filter, enum VKLFilter gradientFilter);
    extern void VdbIterator_Initialize16(const int32_t * imask, void * _self, const void * _context, void * _originObject, void * _directionObject, void * _tRangeWorld);
#if defined(__cplusplus)
    extern void VdbIterator_export16(struct box1f &dummy_box1f, void * it);
#else
    extern void VdbIterator_export16(struct box1f *dummy_box1f, void * it);
#endif // VdbIterator_export16 function declaraion
    extern void VdbIterator_iterateInterval16(const int32_t * imask, void * _self, void * _interval, int32_t * _result);
#if defined(__cplusplus) && (! defined(__ISPC_NO_EXTERN_C) || !__ISPC_NO_EXTERN_C )
} /* end extern C */
#endif // __cplusplus


/* Portable alignment macro that works across different compilers and standards */
#if defined(__cplusplus) && __cplusplus >= 201103L
/* C++11 or newer - use alignas keyword */
#define __ISPC_ALIGN__(x) alignas(x)
#elif defined(__GNUC__) || defined(__clang__)
/* GCC or Clang - use __attribute__ */
#define __ISPC_ALIGN__(x) __attribute__((aligned(x)))
#elif defined(_MSC_VER)
/* Microsoft Visual C++ - use __declspec */
#define __ISPC_ALIGN__(x) __declspec(align(x))
#else
/* Unknown compiler/standard - alignment not supported */
#define __ISPC_ALIGN__(x)
#warning "Alignment not supported on this compiler"
#endif // defined(__cplusplus) && __cplusplus >= 201103L
#ifndef __ISPC_ALIGNED_STRUCT__
#if defined(__clang__) || !defined(_MSC_VER) || _MSC_VER > 1943
// Clang, GCC, ICC, Visual Studio
#define __ISPC_ALIGNED_STRUCT__(s) struct __ISPC_ALIGN__(s)
#else
// Older Visual Studio
#define __ISPC_ALIGNED_STRUCT__(s) __ISPC_ALIGN__(s) struct
#endif // defined(__clang__) || !defined(_MSC_VER) || _MSC_VER > 1943
#endif // __ISPC_ALIGNED_STRUCT__

#ifndef __ISPC_STRUCT_v4_varying_vec3f__
#define __ISPC_STRUCT_v4_varying_vec3f__
__ISPC_ALIGNED_STRUCT__(16) v4_varying_vec3f {
    __ISPC_ALIGN__(16)     float x[4];
    __ISPC_ALIGN__(16)     float y[4];
    __ISPC_ALIGN__(16)     float z[4];
};
#endif

#ifndef __ISPC_STRUCT_v4_varying_DdaState__
#define __ISPC_STRUCT_v4_varying_DdaState__
__ISPC_ALIGNED_STRUCT__(16) v4_varying_DdaState {
    uint32_t level;
    __ISPC_ALIGN__(16)     float t[4];
    struct v4_varying_vec3f rayOrg;
    struct v4_varying_vec3f rayDir;
    __ISPC_ALIGN__(16)     int32_t idx[12][4];
    __ISPC_ALIGN__(16)     float tNext[12][4];
    __ISPC_ALIGN__(16)     float tDelta[12][4];
    __ISPC_ALIGN__(16)     int32_t idxDelta[12][4];
};
#endif

#ifndef __ISPC_STRUCT_v4_varying_VdbIterator__
#define __ISPC_STRUCT_v4_varying_VdbIterator__
__ISPC_ALIGNED_STRUCT__(16) v4_varying_VdbIterator {
    struct DefaultHitIteratorIntervalIterator super;
    const struct VdbGrid * grid;
    __ISPC_ALIGN__(16)     float tMax[4];
    __ISPC_ALIGN__(16)     float nominalDeltaT[4];
    struct v4_varying_DdaState dda;
};
#endif



#ifdef __cplusplus
} /* namespace */
#endif // __cplusplus
