// Copyright (c) 2021-2021 NVIDIA CORPORATION.  All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto.  Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#pragma once

namespace carb {
namespace flatcache {

/**
 * @enum PtrToPtrKind
 *
 * @details When getting an array-valued attribute for GPU access, you can
 *          optionally use this enum to ask for a GPU pointer to the GPU data
 *          pointer (eGpuPtrToGpuPtr), or a CPU pointer to the GPU data
 *          pointer (eCpuPtrToGpuPtr).
 *          The advantage of using eCpuPtrToGpuPtr is that you can dereference
 *          the returned pointer on the CPU, and pass the GPU data pointer as
 *          a CUDA kernel parameter.
 *          The advantage of using eGpuPtrToGpuPtr is that it makes it easier
 *          to extend kernels to operate on arrays of arrays later. Also it
 *          allows us to support allocation and resizing of array-valued
 *          attributes on the GPU in the future.
 *
 *          PtrToPtrKind is not a parameter of methods returning arrays of
 *          arrays, for example getArrayGPU(). This is because there is no way
 *          to pass a variable length array of GPU pointers to a kernel using
 *          its CPU launch parameters. So GPU arrays of arrays always have to
 *          be passed to kernels as a GPU pointer to an array of GPU pointers.
 */
enum class PtrToPtrKind
{
    eNotApplicable = 0,
    eGpuPtrToGpuPtr = 0, // eGpuPtrToGpuPtr == eNotApplicable for backward compatibility
    eCpuPtrToGpuPtr = 1
};

} // namespace flatcache
} // namespace carb
